T4A — Vision domain shift (single-layer / ResNet)¶
Paper evidence: main.pdf · Block findings
Lemma: D4 · Stack: pytorch
Nuisance key: domain_shift
Production change: New camera, site, or geography; same classes.
Notebook (Run All, built-in demo): t04a-vision-domain.ipynb
pip install matching-pmh torch
# Open the notebook and Run All
What this task achieved (headline)¶
E1_multiscale Gram PMH on DomainNet real→sketch: 42.15% test acc (+3.31 pp vs B0 38.84%).
| B0 | E1 | E1_multiscale |
|---|---|---|
| 38.84% | 39.34% | 42.15% |
Paper preset: t4_domain_d4 · from pmh.benchmark.presets import get_preset
Note: Notebook = single-hook D4 with class-aligned Gram when loaders are (x,y). Paper multiscale DomainNet: the paper (DomainNet multiscale).
Subtasks (paper)¶
DomainNet real→sketch¶
E1_multiscale +3.31 pp test acc.
Preset: t4_domain_d4
Per-layer TDI geometry¶
Domain Gram on hook features.
Preset: t4_domain_d4
B0 / E1 / E1_multiscale training¶
Preset: t4_domain_d4
Run with matching-pmh¶
from pmh import PMHTrainer, evaluate_robust_fit
# nuisance="domain_shift"
Do not use PMH when¶
New classes at deploy without relabeling.
Replace demo data with yours¶
Swap demo loaders for your train_loader, source_batches, target_batches, and deploy holdout. Hook the backbone before your task head.