You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lock full-fit numerical parity between AMICA_NumPy and AMICATorchNG #37
We are keeping both the NumPy reference (AMICA_NumPy) and the PyTorch AMICATorchNG backend. AMICATorchNG was ported line-by-line from the NumPy _get_block_updates/_update_parameters, and the suite already proves per-block numerical parity to ~1e-8 (test_sufficient_stats_match_numpy_reference, test_newton_stats_match_numpy_reference, test_newton_mstep_matches_numpy_reference, test_multimodel_sufficient_stats_match_numpy_reference).
What is missing is an explicit full-fit head-to-head test: today each backend is validated only against the Fortran binary, not against each other end-to-end.
Scope
Add a @pytest.mark.slow real-data test that fits AMICA_NumPy and AMICATorchNG independently with the same single-model config and asserts they converge to the same solution: final LL within tolerance, and Hungarian-matched total-spatial-filter (unmixing @ sphere) correlation near 1.0.
Thresholds set empirically from a measured run (not guessed) to avoid flakiness.
Note on "identical"
Per-step update math is identical to ~1e-8 (already tested). A full multi-iteration fit is NOT bit-identical across NumPy and PyTorch (float reduction order / BLAS vs ATen), which is expected; the bar is "same converged solution", not bit-identical trajectories.
Activity
Add full-fit NumPy<->NG parity test (#37)
Merge pull request #38 from neuromechanist/37-lock-full-fit-numerical…