# Synthetic-switch training of the 10 s classifier

Training-distribution change only. Same `vlaai_ws` front-end as the stem_ms96 recipe: prep `eaP_n5_t60`, window 10 s, 3 blocks, sw2 (`p_switch 0.5`, `clf_p_switch2 0.5`), SparrKULee init, Fuglsang extra train. Each train and validation trial is stamped with one full-trial switch schedule before windowing. The schedule is a fixed 50/50 coin flip, keyed by trial id: uniform gaps on [8, 20] s (`draw_switch_times` mean 14, min 8) or the existing official gaps on [30, 90] s (mean 60, min 30). The coin flip was not chosen on AASD or Carta labels.

1000 steps per fit (4 epochs × 250). Five LODO folds, then one all-five model for external scoring. Headline HMM is the pre-specified pair p_stay 0.994, emission scale 0.8 (sd × 0.8). Emissions for a held-out corpus set come from the other four folds. Emissions for AASD and Carta come from all five LODO folds. No test-label tuning.

## Command

```bash
cd /root/disk_3tb/eeg-thao
export PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 OMP_NUM_THREADS=8 MKL_NUM_THREADS=8 GLIMPSE_THR=norm
flock /root/disk_3tb/eeg-thao/multi_agent_opt/gpu.lock \
  /root/disk_3tb/EEG-sAAD-Grand-Challenge-Training-Dataset/.venv/bin/python -u direct_classifier.py \
  --prep eaP_n5_t60 --window-s 10 --tag _w10b3_ptSPK_aug-sw2_swmix \
  --set model_blocks=3 --aug-set clf_p_switch2=0.5 --p-switch 0.5 \
  --min-epochs 4 --max-epochs 4 --trial-switch mix820 \
  --init-from /root/disk_3tb/EEG-sAAD-Grand-Challenge-Training-Dataset/experiments/decoder_lodo/models/pretrain_spk_direct_clf_w10_b3_s0.pt
```

Code: `direct_classifier.py` (`stamp_mixed_switches`, `--trial-switch mix820`). Log: `experiments/technique_synth_switch.log`. Scores: `results/direct_clf__eaP_n5_t60_w10b3_ptSPK_aug-sw2_swmix.json`.

## Metrics

H is the official harmonic mean (fraction). Acc is subject-mean sample accuracy after the HMM (percent). This run uses p_stay 0.994 and scale 0.8 on every row. `stem_ms96` numbers are the published nested LODO rows (USTC used p_stay 0.996; the other four used 0.994 / 0.8). `linear_hp30` train rows are the published official nested HMM; its AASD and Carta rows are the preset 0.994 / 0.8.

| Dataset | swmix H | swmix Acc | stem_ms96 H | stem_ms96 Acc | linear_hp30 H | linear_hp30 Acc |
|---|---:|---:|---:|---:|---:|---:|
| AVGC | 0.6965 | 65.70 | 0.7945 | 74.06 | 0.7414 | 66.48 |
| DTU | 0.8186 | 73.06 | 0.9061 | 89.85 | 0.8101 | 69.42 |
| KUL | 0.7732 | 70.71 | 0.8755 | 82.33 | 0.8266 | 72.05 |
| UHD | 0.7486 | 69.31 | 0.8407 | 79.47 | 0.7686 | 69.77 |
| USTC | 0.7845 | 69.96 | 0.9219 | 86.36 | 0.8031 | 68.33 |
| AASD | 0.6421 | 53.26 | 0.6158 | 51.54 | 0.6422 | 53.12 |
| Carta | 0.6450 | 59.82 | 0.5695 | 51.03 | 0.6520 | 60.54 |

LODO mean for this run: H 0.7643, Acc 69.75.

AVGC moved away from H 0.85 and Acc 78 (0.6965 / 65.70 versus stem_ms96 0.7945 / 74.06). UHD H moved away from 0.85 (0.7486 versus 0.8407). AASD accuracy moved from 53.12 to 53.26, toward 60 by 0.14 points, and still misses.
