# results_focal_stem_avgc

Focal-BCE fine-tune of `stem_ms96` from IRM (preferred). Replace recipe BCE with Lin et al. focal:
`FL = α_t · (1−p_t)^γ · BCE`, keep post-switch weights + TV. Architecture unchanged (ms, w96).
Init `models/stem_ms96_irm/{held-*,all5}.pt`; causal `-inf` mask restored. EMA 0.995.
Smoke γ∈{1.0,2.0} × α∈{None,0.25} (40 steps, held-AVGC) → **γ=1.0, α=None** (frame-acc 0.938).
Full 800 steps, batch 512. HMM 0.994/0.8 + hp30. Also score **fuse w=0.5** with frozen `stem_synth_switch`.

**Distinct from** AVGC λ upweight, avgc-curriculum, soft-H, fuse-conf-resid, PCGrad/SAM.

Code: `stem_ms96_focal_avgc.py`. Checkpoints: `models/stem_ms96_focal_avgc/`.
JSON: `results/research/stem_ms96_focal_avgc.json`.
Log: `experiments/stem_ms96_focal_avgc.log` / `_console.log`.

## LODO (preset)

| Held-out | focal H | Acc % | fuse_w0.5 H/Acc | IRM | IRM↔synth tip | hp30 H | hp30 Acc % |
|---|---:|---:|---|---|---|---:|---:|
| AVGC | 0.8065 | 75.16 | **0.8226 / 75.54** | 0.8095/75.12 | 0.8192/75.52 | 0.7719 | 70.77 |
| DTU | 0.8976 | 88.71 | 0.9207 / 90.44 | 0.8999/88.88 | — | 0.8282 | 71.18 |
| KUL | 0.8621 | 81.41 | 0.8783 / 82.86 | 0.8702/81.84 | — | 0.8416 | 73.93 |
| UHD | 0.8536 | 80.05 | 0.8587 / 80.69 | 0.8530/79.96 | 0.8614 | 0.8011 | 72.94 |
| USTC | 0.9188 | 86.01 | 0.9300 / 87.25 | 0.9148/85.96 | — | 0.8336 | 71.52 |
| **mean** | **0.8677** | **82.27** | **0.8821 / 83.36** | 0.8695/82.35 | **0.8790/83.11** | | |

## External (preset)

| Set | focal H/Acc | fuse_w0.5 H/Acc | linear_hp30 | IRM↔synth fuse |
|---|---|---|---|---|
| AASD | 0.6192 / 51.05 | 0.6208 / 51.06 | 0.6422/53.12 | 0.6187/50.92 |
| Carta2026 | 0.5379 / 47.64 | 0.5496 / 49.14 | 0.6520/60.54 | 0.5497/49.09 |

## Targets

| Target | Result |
|---|---|
| AVGC ≥0.85 / Acc≥78 | **miss** — pure focal 0.8065/75.16; fuse_w0.5 **0.8226/75.54** (Δtip **+0.0034 H / +0.02 Acc** vs 0.8192/75.52) |
| Keep / beat IRM↔synth LODO tip | **yes on fuse** — mean **0.8821/83.36** vs 0.8790/83.11; UHD H 0.8587 kept ≥0.85 |
| AASD Acc>60 | miss (~51) |

## Notes

- Smoke preferred γ=1.0 without α (highest frame-acc; α=0.25 / γ=2 collapsed mean_mod).
- Pure focal ≈ IRM family; alone does **not** beat the tip.
- Focal-IRM ↔ synth fuse w=0.5 is a **new LODO mean + AVGC tip** (+0.0034 H on AVGC; +0.0031 mean H). Still far from 0.85/78.
- AASD Acc frozen ~51.

## NEXT IDEA

Stop re-tuning stem BCE variants (focal / soft-H / λ / curriculum all saturate near IRM). Prefer a **subject- or trial-adaptive stem readout** on the new tip fuse (e.g. causal per-subject temperature / scale on focal↔synth evidence selected on LODO Acc then H), or leave LODO tip and push Acc only on the Acc front-end — do **not** reopen AVGC hard curricula or another focal γ grid.
