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
Phase 2: Isolated correctness fixes (3 math bugs) #11
Per-source mixture factorization: compute sum_i log sum_k alpha_{k,i} f_k(y_{i,t}), not sum-over-sources-then-logsumexp. Fix _compute_gg_log_pdf_vectorized / compute_log_likelihood in amica_torch.py (and v2 fallback).
Per-source alpha: use alpha[k, :] per source, not alpha_k.mean() (amica_torch.py:187, amica_torch_v2.py:259).
LL normalization: divide by n_samples * nw and drop the extra n_samples*log_det_W term to match Fortran units (amica17.f90:1866).
Done when
All three fixes land with tests locking them to Fortran values; Phase 1 baseline report shows improved per-channel LL scale (~ -3.4 range) and no regression in correlation.
Lead from Phase 1 review (PR #14): the legacy-NumPy Newton NaN (behind test_amica.py::test_full_amica and test_pyAMICA.py::test_full_pipeline) traces to a divide-by-zero at pyAMICA/pyAMICA.py:747 and :751 (dmu = updates['dmu'] / updates['dalpha'], dbeta = ... / updates['dalpha']) when a mixture component's dalpha collapses to zero. Looks like a clean guard/clamp fix in Phase 2 scope (Fortran floors these with epsilon), not something needing the Phase 3 rewrite. Add a regression test that exercises the collapse case.
Activity
neuromechanist commentedon Jul 2, 2026
Lead from Phase 1 review (PR #14): the legacy-NumPy Newton NaN (behind test_amica.py::test_full_amica and test_pyAMICA.py::test_full_pipeline) traces to a divide-by-zero at
pyAMICA/pyAMICA.py:747and:751(dmu = updates['dmu'] / updates['dalpha'],dbeta = ... / updates['dalpha']) when a mixture component'sdalphacollapses to zero. Looks like a clean guard/clamp fix in Phase 2 scope (Fortran floors these with epsilon), not something needing the Phase 3 rewrite. Add a regression test that exercises the collapse case.neuromechanist commentedon Jul 3, 2026
Phase 2 (isolated correctness fixes) delivered via epic #9, on main in PR #28. Closing.
Address PR #35 review findings