Skip to content

Commit 22bb6f5

Browse files
authored
Merge pull request #265 from CSSLab/maia3-launch
Maia3 launch
2 parents bacfb7f + 731ced8 commit 22bb6f5

4 files changed

Lines changed: 10 additions & 9 deletions

File tree

public/maia3/maia3_simplified.onnx

-43.2 MB
Binary file not shown.

src/components/Common/DownloadModelModal.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export const DownloadModelModal: React.FC<Props> = ({
103103

104104
<div className="flex flex-col gap-3 text-sm md:text-base">
105105
<p className="text-primary/80">
106-
Our newest model, Maia 3, provides richer and more in-depth
106+
Our newest model, Maia-3, provides richer and more in-depth
107107
analysis, allowing for:
108108
</p>
109109
<ul className="flex list-inside flex-col gap-1.5 pl-2 text-white/80">
@@ -120,7 +120,7 @@ export const DownloadModelModal: React.FC<Props> = ({
120120
</li>
121121
</ul>
122122
<p className="text-white/80">
123-
Maia 3 runs entirely on your device and requires a one-time 87mb
123+
Maia-3 runs entirely on your device and requires a one-time 44mb
124124
download.
125125
</p>
126126
</div>
@@ -174,8 +174,8 @@ export const DownloadModelModal: React.FC<Props> = ({
174174
</span>
175175
)}
176176
<p className="font-medium">
177-
{isDownloading ? 'Downloading...' : 'Download Maia 3'}{' '}
178-
<span className="text-xs text-white/70">(87mb)</span>
177+
{isDownloading ? 'Downloading...' : 'Download Maia-3'}{' '}
178+
<span className="text-xs text-white/70">(44mb)</span>
179179
</p>
180180
</div>
181181
</div>

src/contexts/MaiaEngineContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const MaiaEngineContextProvider: React.FC<{ children: ReactNode }> = ({
3737
model:
3838
process.env.NEXT_PUBLIC_MAIA_MODEL_URL ??
3939
'/maia3/maia3_simplified.onnx',
40-
modelVersion: process.env.NEXT_PUBLIC_MAIA_MODEL_VERSION ?? '2',
40+
modelVersion: process.env.NEXT_PUBLIC_MAIA_MODEL_VERSION ?? '3',
4141
setStatus: setStatus,
4242
setProgress: setProgress,
4343
setError: setError,

src/lib/engine/maia.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,12 +451,13 @@ function processOutputsMaia3(
451451
const logits = logits_move.data as Float32Array
452452
const wdl = logits_value.data as Float32Array
453453

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

0 commit comments

Comments
 (0)