# results_dann_grl_stem

Domain-adversarial / gradient-reversal (DANN) fine-tune of `stem_ms96` from **focal-IRM** (`models/stem_ms96_focal_avgc`). Domains = train dataset ids during LODO (held-out never a domain label). Classic λ ramp to `λ_max`; smoke chose **λ_max=0.1**. EMA 0.995. HMM **0.994 / 0.8**. Also **fuse w=0.5** with frozen `stem_ms96_synth_switch` (tip protocol).

**Not** IRM penalty / PCGrad / Mixup·focal re-grids / CORAL-on-logits / multi-stem soft-attn.

Code: `stem_ms96_dann_grl.py`. JSON: `results/research/stem_ms96_dann_grl.json`. Ckpts: `models/stem_ms96_dann_grl/`.

## Smoke

| λ_max | frame-acc | AVGC H/Acc | near_chance |
|------:|----------:|------------|-------------|
| 0.1 | 0.948 | 0.8109/75.26 | no |
| 0.5 | 0.948 | 0.8106/75.18 | no |
| 1.0 | 0.951 | 0.8044/75.38 | no |

Chose **λ_max=0.1**.

## Pure DANN LODO @0.994/0.8

| Held | H | Acc |
|------|--:|----:|
| AVGC | 0.8042 | 74.92 |
| DTU | 0.8959 | 88.64 |
| KUL | 0.8618 | 81.12 |
| UHD | 0.8382 | 79.34 |
| USTC | 0.9098 | 85.24 |
| **mean** | **0.8620** | **81.85** |

AVGC vs tip fuse **0.8226/75.54**: ΔH **−0.0184**, ΔAcc **−0.62**. Miss ≥0.85/78.

## Fuse w=0.5 DANN↔synth

| Held | H | Acc |
|------|--:|----:|
| AVGC | 0.8199 | 75.46 |
| DTU | 0.9100 | 90.10 |
| KUL | 0.8742 | 82.46 |
| UHD | 0.8582 | 80.39 |
| USTC | 0.9225 | 86.44 |
| **mean** | **0.8770** | **82.97** |

AVGC fuse vs tip **0.8226/75.54**: ΔH **−0.0027**, ΔAcc **−0.08**. UHD H ≥0.85 kept. Below tip LODO **0.8821/83.36**.

## External (all5 DANN)

| Set | pure H/Acc | fuse w=0.5 H/Acc | vs Acc tip 53.53 / Carta hp30 60.54 |
|-----|------------|------------------|-------------------------------------|
| AASD | 0.6200/**50.87** | 0.6209/**50.96** | ΔAcc ≈−2.6 vs tip; Acc>60=**NO** |
| Carta2026 | 0.5391/47.91 | 0.5522/48.97 | ≪60.54 |

## Tip moved?

**NO.** LODO/AVGC tip remains focal↔synth w=0.5 **0.8821/83.36; AVGC 0.8226/75.54**. Acc tip remains SW2↔swmix **53.53**.

## Verdict

DANN/GRL on stem features from focal-IRM does not lift AVGC toward 0.85/78 and regresses AASD Acc vs Acc tip. Mild domain CE (λ_max=0.1) preserves frame-acc but does not buy transfer. Do not re-grid DANN λ on this stem.

## NEXT IDEA

Unused GPU-side invariant pretrain: **VICReg or temporal-CPC on stem ms windows → LODO FT** (not Mixup/focal/IRM/DANN re-tunes, not classical Acc Path A, not switch-schedule, not multi-stem attn). Or a qualitatively new Acc front-end warmed from published evidence without tip PP.
