A · EnvironmentWhere this ran
A Hermes agent container (Matilde) on a Mac mini host. The constraint that shaped
everything: a 4GB cgroup memory cap (memory.max=4294967296).
No GPU. Python 3.13, numpy, nibabel. All data pulled from the OpenNeuro file API over plain
HTTPS. Nothing here requires more than a laptop and patience — the Forrest all-runs analysis
is the long pole at ~12 hours wall-clock.
B · The math, exactlyWhat "alignment" computes
Identical for both datasets; per held-out subject s:
1. X_s ← z-scored BOLD, shape (T, V) # per voxel, over the full run
2. Split: train = first 2/3 of T, test = last 1/3
3. Basis B ← top-k=100 PCs of mean_{s'≠s}(X_s'^train) # LOSO: s excluded
4. Others' mean M ← mean_{s'≠s}(X_s'^train @ B) # in basis coords
5. Rotation R_s ← argmin ||X_s^train @ B @ R − M||_F s.t. R orthogonal
→ closed form: SVD of (X_s^train @ B)ᵀ M, R = U Vᵀ
6. Score on test: time-segment matching —
acc = mean_t [ argmax_t' cos( (X_s^test @ B @ R)_t , (M̄^test)_t' ) = t ]
anatomical condition: same, with R = I (identity)
Statistics: per-subject Δ = acc_aligned − acc_anatomical; paired sign test; permutation test on the mean Δ (1000 draws, sign-flip null); for the all-runs Forrest design, Δ is pooled per subject across runs first (mean of 8 per-run Δs), giving a 19-vector whose bootstrap 95% CI and permutation p are reported.
C · Recreation recipeFrom zero to numbers
# AOMIC (Koyaanisqatsi), ~2.4GB download, ~2h analysis
download_aomic.py # ds003097, fsaverage5 moviewatching L+R, 93 subjects
hyperalign_aomic.py # pilot (group-mean basis — leaked, superseded)
hyperalign_loso.py # strict LOSO → aomic_loso_results.json ← the reported result
positive_control.py # synthetic 40-subject rotated data → Δ=+0.25, 40/40
# StudyForrest (Forrest Gump), ~40GB download, overnight
download_forrest_full.py # ds000113 grpbold7Tad, runs 1–8, 20 subjects, + brain mask
hyperalign_forrest.py # run-01 pilot, N=8 → forrest_loso_results.json
hyperalign_forrest_allruns.py# all 8 runs × 19 subjects, per-run pooled
# → forrest_loso_allruns_results.json ← the reported result
Seeds are fixed (42). Subject lists and manifests are written next to the results. Re-running the reported scripts reproduces the reported JSONs byte-for-byte in the metric fields.
D · Failure logWhat broke, in order
E · Result inventoryEvery JSON and what it is
| File | Design | N | Δ (aligned − anatomical) | Status |
|---|---|---|---|---|
aomic_tier1_results.json | pilot, leaked basis (fixed) | 93 | −0.027 | superseded, consistent |
aomic_loso_results.json | strict LOSO | 93 | −0.026 · p<0.001 | reported |
positive_control (synthetic) | known rotations | 40 | +0.25 · 40/40 | reported |
forrest_loso_results.json | run-01 only | 8 | +0.002 · p=0.86 | kept as underpowered record |
forrest_loso_allruns_results.json | 8 runs, per-subject pooled | 19×8 | +0.011 · CI [0.0065, 0.0153] · p<0.001 | reported |
F · Known limitsWhat this does not show
Two films, one matching metric, one alignment family (linear Procrustes into a PCA basis). The boundary we measured is real for this operationalization; SRM-style probabilistic alignment, searchlight-wise transforms, or representational-similarity metrics might move it. Absolute accuracies differ across datasets by construction (space, TR count, test length) and are not comparable — only within-dataset deltas are. Four of 19 Forrest subjects went negative; mean effects are not universal effects. The per-subject delta matrix ships with the results precisely so follow-up work can ask why.