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
AMICA_NumPy long fit drifts/degrades past ~150 iters (LL decreases, component match drops) #41
Surfaced while resolving #39. With a fixed stable seed (seed=0) the NumPy backend no longer NaNs on the full 2000-iter sample config (the #39 restart mechanism + pinned seed), but the solution degrades over the long run:
iters
normalized LL
Hungarian W-match vs Fortran (min / mean, n>0.8)
150
-3.4043
0.921 / 0.970, 32/32
2000
-3.4093
some < 0.8 (test fails)
The LL decreases between iter ~150 and 2000 (worse solution with more iterations) and several component correlations drop below the 0.8 gate. At ~150 iters the match is excellent (32/32), so the backend finds the right solution and then drifts away from it.
The natural-gradient A-update is a gradient step (with lrate), not strict EM, so it can overshoot/oscillate. Fortran runs the same 2000-iter config and stays converged (the reference amicaout), so this is a convergence-schedule / stability parity gap (lrate ratchet / numdecs / Newton ramp), distinct from:
Fixed: the LL-degradation drift. Two convergence bugs were corrected: numdecs/numincs never accumulated (they were incremented inside _check_convergence but never returned), and pyAMICA stopped at numdecs >= max_decs where Fortran (amica17.f90:1062-1108) instead ratchets the learning-rate ceiling (lrate0/newtrate/rholrate0) down and continues. With the Fortran-faithful ratchet, the seed=0 fit now improves over the long run (LL -3.399 at 2000 iters, vs the pre-fix -3.409 and the ~150-iter -3.404, and better than Fortran's -3.402). The 150-iter mean-corr parity test is unaffected.
Residual (why test_sample_data_cli stays xfail): the strict all-32-components > 0.8 gate still fails (~27/32). At full convergence pyAMICA reaches a comparable/slightly-better-LL but different-partition solution than the Fortran reference on a few ill-determined components -- a solution-basin difference, not a drift. This is really the single-model tail of #27 (partition ambiguity); the project's other parity test uses the more appropriate mean > 0.9 bar and passes. Suggest tracking the residual under #27 (or relaxing the CLI gate to a mean-based metric) and closing this issue as the drift itself is fixed.
Activity
Re-xfail CLI test for the #41 long-run drift
Ratchet the learning rate on LL decrease (#41)
Merge pull request #43 from neuromechanist/41-amica_numpy-long-fit-dr…
neuromechanist commentedon Jul 5, 2026
Partially resolved by PR #43.
Fixed: the LL-degradation drift. Two convergence bugs were corrected:
numdecs/numincsnever accumulated (they were incremented inside_check_convergencebut never returned), and pyAMICA stopped atnumdecs >= max_decswhere Fortran (amica17.f90:1062-1108) instead ratchets the learning-rate ceiling (lrate0/newtrate/rholrate0) down and continues. With the Fortran-faithful ratchet, the seed=0 fit now improves over the long run (LL -3.399 at 2000 iters, vs the pre-fix -3.409 and the ~150-iter -3.404, and better than Fortran's -3.402). The 150-iter mean-corr parity test is unaffected.Residual (why
test_sample_data_clistays xfail): the strict all-32-components > 0.8 gate still fails (~27/32). At full convergence pyAMICA reaches a comparable/slightly-better-LL but different-partition solution than the Fortran reference on a few ill-determined components -- a solution-basin difference, not a drift. This is really the single-model tail of #27 (partition ambiguity); the project's other parity test uses the more appropriatemean > 0.9bar and passes. Suggest tracking the residual under #27 (or relaxing the CLI gate to a mean-based metric) and closing this issue as the drift itself is fixed.