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
The Fortran reference normalizes every component of a randomly drawn initial mixing matrix to unit norm (pamica/amica15.f90:818-819, A(:,i) = A(:,i) / Anrmk), and does the same when its restart-on-NaN path redraws A (:1039-1040). It does not normalize a loaded A (:793-800). pamica's torch, NumPy and MLX backends do not normalize their drawn initial A, so the first E-step runs on components whose norm is not 1. With doscaling on (the default), the first rescale fixes the scale after iteration 1, so the effect is confined to the first iteration. With doscaling=False, the unnormalized scale persists for the whole fit.
Fix
Normalize each component of a drawn initial A (and of the NumPy restart redraw) to unit norm, as the reference does, identically in all three backends, in the component-row storage layout of epic #324 Phase 8 (#334). Leave a user-supplied or loaded A untouched, as the reference does. Record the trajectory change in the changelog. Gates: an always-on cross-backend test that the initial components have unit norm before the first update (and that a supplied A is untouched); a gated native-binary oracle from a seeded unnormalized draw, if Fortran's load_A path can reproduce the drawn-then-normalized init; otherwise document why not.
Decided during the epic #324 Phase 7 review (#340; ADR 0006 records it). Part of epic #324; runs after Phase 8.
Activity
Phase 8: store components as rows and fix sharing (#342)
Merge the epic (Phase 13) into Phase 12
Start the pre-344 control from the new init
Phase 12: normalize the drawn initial mixing matrix (#350)