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
share_comps similarity space differs: torch sensor-space, numpy sphered-space #258
Found during #253 (PR #256). The two backends compute the component-sharing similarity in different spaces, so they can select different merge pairs on the same data.
torch_impl's _identify_shared_comps de-spheres the mixing columns before the |cos| comparison (now pinv(sphere) @ A, the Fortran Spinv mapping, amica15.f90:1898 + :550-560). numpy_impl/utils.py:identify_shared_components (line 103) correlates the columns of A directly in the sphered space -- it never touches the sphere at all (verified line 45: np.dot(A[:, k1], A[:, k2]) on raw A).
Fortran compares de-sphered sensor-space maps, so torch matches the reference and numpy is the divergent one. Because ZCA sphering is not orthogonal, |cos| in the two spaces genuinely differs and merge decisions near comp_thresh can flip.
Work
Port the sensor-space (pseudo-inverse de-sphered) comparison to numpy_impl's identify_shared_components, matching torch/Fortran
Cross-backend test: same data/config produce the same merge pairs (.rules/backend_parity.md)
Should land after the in-flight #240/#242 numpy sharing rework to avoid conflicts. The divergence is recorded in docs/guides/amica-differences.md by PR #256 until fixed.
Completed in PR #266, squash-merged into the epic branch feature/issue-260-epic-mlx-parity (commit 7c50e83). Both numpy and torch backends now measure sharing similarity on de-sphered sensor-space maps (pinv(sphere) @ A); reaches dev with the epic #260 final merge.
Activity
Phase 1: sensor-space sharing similarity for numpy (#266)
neuromechanist commentedon Aug 23, 2026
Completed in PR #266, squash-merged into the epic branch feature/issue-260-epic-mlx-parity (commit 7c50e83). Both numpy and torch backends now measure sharing similarity on de-sphered sensor-space maps (pinv(sphere) @ A); reaches dev with the epic #260 final merge.