Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified public/maia3/maia3_simplified.onnx
Binary file not shown.
8 changes: 4 additions & 4 deletions src/components/Common/DownloadModelModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const DownloadModelModal: React.FC<Props> = ({

<div className="flex flex-col gap-3 text-sm md:text-base">
<p className="text-primary/80">
Our newest model, Maia 3, provides richer and more in-depth
Our newest model, Maia-3, provides richer and more in-depth
analysis, allowing for:
</p>
<ul className="flex list-inside flex-col gap-1.5 pl-2 text-white/80">
Expand All @@ -120,7 +120,7 @@ export const DownloadModelModal: React.FC<Props> = ({
</li>
</ul>
<p className="text-white/80">
Maia 3 runs entirely on your device and requires a one-time 87mb
Maia-3 runs entirely on your device and requires a one-time 44mb
download.
</p>
</div>
Expand Down Expand Up @@ -174,8 +174,8 @@ export const DownloadModelModal: React.FC<Props> = ({
</span>
)}
<p className="font-medium">
{isDownloading ? 'Downloading...' : 'Download Maia 3'}{' '}
<span className="text-xs text-white/70">(87mb)</span>
{isDownloading ? 'Downloading...' : 'Download Maia-3'}{' '}
<span className="text-xs text-white/70">(44mb)</span>
</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/contexts/MaiaEngineContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const MaiaEngineContextProvider: React.FC<{ children: ReactNode }> = ({
model:
process.env.NEXT_PUBLIC_MAIA_MODEL_URL ??
'/maia3/maia3_simplified.onnx',
modelVersion: process.env.NEXT_PUBLIC_MAIA_MODEL_VERSION ?? '2',
modelVersion: process.env.NEXT_PUBLIC_MAIA_MODEL_VERSION ?? '3',
setStatus: setStatus,
setProgress: setProgress,
setError: setError,
Expand Down
9 changes: 5 additions & 4 deletions src/lib/engine/maia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,12 +451,13 @@ function processOutputsMaia3(
const logits = logits_move.data as Float32Array
const wdl = logits_value.data as Float32Array

// Convert WDL logits to win probability via softmax
// Convert LDW logits to win probability via softmax
// Model output channels: index 0 = Loss, 1 = Draw, 2 = Win (for side-to-move)
const maxWdl = Math.max(wdl[0], wdl[1], wdl[2])
const expW = Math.exp(wdl[0] - maxWdl)
const expL = Math.exp(wdl[0] - maxWdl)
const expD = Math.exp(wdl[1] - maxWdl)
const expL = Math.exp(wdl[2] - maxWdl)
const sumExp = expW + expD + expL
const expW = Math.exp(wdl[2] - maxWdl)
const sumExp = expL + expD + expW
// Win probability = P(win) + 0.5 * P(draw)
let winProb = (expW + 0.5 * expD) / sumExp

Expand Down
Loading