Repository navigation
Phase 16: audit the documentation against the epic (#352) - #353
Merged
neuromechanist merged 28 commits intoSep 23, 2026
Merged
neuromechanist merged 28 commits into
neuromechanist merged 28 commits into
Conversation
choose_pdf_type had no callers, and compute_pdf's pdftype 2-4 branches were unreachable: every caller uses the generalized Gaussian. Tested with the pdf, reference-constant and viz suites.
Rewrap docstring lines that began with an issue number, which the API pages rendered as headings; state the sphered-space shapes of the wrapper's mixing and unmixing accessors; name restart_error among the degenerate stops; drop the claim that natural gradient alone falls short of the reference; fix the NumPy n_channels and doscaling wording. Checked on the bundled sample (accessor shapes and composition).
The reference resets its decrease count only at each ratchet and when Newton switches on (amica15.f90:1062-1076), as every backend does.
How AMICA works now walks one iteration as the code runs it: the E-step, the likelihood-decrease response and stopping checks, the exit before any update, then the update with Newton, the A-freeze windows and the doscaling rescale. The false claim that every iteration raises the likelihood is gone, and the flow figure shows the checks before the update. What is AMICA covers the unit-norm scale convention.
Auto device selection picks MPS first and the wrapper redirects it to CPU for float64; the raw AMICATorchNG raises there instead (checked on this host). CUDA float32 is about as fast as float64, not faster, as the same page says above. The native backend is listed, the wrappers' two backends and their parameter-file route are stated, and a stale 'sweep is being finalized' note points to the published sweeps.
With device=None it picks MPS first and, at the float64 default, raises on an Apple machine; the AMICA wrapper redirects to CPU. Checked on this host.
pamica is on PyPI (0.3.3), so getting started no longer says a release is planned, and says unreleased changes need a source install. The README's get_mixing_matrix comment called the sphered-space matrix scalp maps; the examples now use get_sensor_mixing_matrix for maps. The home page no longer calls float32 faster, the final_ll_ note covers the max_iter case, and the NumPy CLI takes either parameter-file format.
List AMICANative in the public import surface; install extras with uv from PyPI or a source checkout; correct the NumPy page's n_channels claim (the raw PyTorch and MLX constructors take it) and list what that backend lacks; drop the viz page's reference to the closed #159 as an open question; replace em-dashes in list items.
amica15_header.f90 declares do_newton = .false.; only the bundled input.param turns it on. The Newton docstrings and the concept page said the reference runs Newton by default.
The reference compiles do_newton off (only the bundled input.param turns it on); row 5 names singular_ll; the backend table gains the variance_order, scoring and wrapper rows and the wrapper .pt save; an obsolete pre-#334 comparison of two retired sharing metrics is replaced by the current single-kernel account; the LLt exception names the last iteration; table cells say none instead of an em-dash.
Group the phase entries by what changed (fitting, MLX and the wrappers, the MNE wrapper, persistence and exports, fixes, removals, docs) and open with a warning that default fits differ from 0.3.3 and why. Drop the entries a later phase superseded (Phase 8's pending #344 note, the polish round's harness and Phase 1's remaining-gap notes), merge the duplicate pdftype-default entries, correct the n_channels claim, and mark measurements taken before later phases. No figure is changed.
Add rank, schedule, initialization, component_layout and reference_constants (with blocktune, restarts and the params reader) as the shared-decision modules, plus mne_compat, native and metrics; name amica15.f90 as the reference source; add a status line for the reference-fidelity changes and the #306/#339 degenerate-fit extensions; shorten the epic #278 history sentence.
The testing page names AMICA_RUN_FORTRAN=1 and the mne_tests directory; the MNE page's source formula includes the per-channel-type scaling the export applies.
Drop negation-contrast and candor framing outside the Validation section, count releases as of today (nine, six on PyPI), and describe the MEG status as end-to-end use without measured parity.
The docstring called W @ get_sphere() the full transform; transform also subtracts the mean before sphering and the model center after. The MIR docstrings and the metrics page now call W @ sphere the linear part. Checked on the bundled sample with two models: the full formula matches transform exactly, W @ sphere @ X is off by up to 4.2, and MIR is unchanged by a shift of the data.
The opening warning said the schedule gates and component rows matter only with Newton, rejection, restarts or sharing; they also reach plain default fits in narrow cases (a maxdecs ratchet past newt_start, and the per-component ndtmpsum sum near a grad-norm stop). The stopping iteration's skipped steps are listed in code order (kurtosis switch, share scan, MIR waypoint, rejection), in ADR 0008 too, and the #304 entry says the fit applies the file's settings.
Prose only; no figure on those lines changed.
from_params_file stores the file's settings on the instance; fit passes them to the backend constructor as defaults and emits the warning.
Reword contrast framings in the concept page, home page, viz page and module docstring, and the differences guide's opening, per the style rule: say what the code does and its known effect.
neuromechanist
merged commit Sep 23, 2026
3fbe1ab
into
feature/issue-324-epic-mlx-first-class
9 checks passed
This was referenced Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #324, closes #352 on the epic merge.
Audits the documentation against the finished epic code and cleans up what the phases left behind.
Parity figures and
paper.mdare untouched: they belong to #351.What was checked
docs/(concepts, guides, API, getting started, development, index, changelog) andREADME.md, statement by statement against the codeAMICA,AMICAICA,AMICATorchNG,AMICAMLXNG,AMICA_NumPyandAMICANative(the API pages render them)amica15_header.f90)nan_ll,singular_ll,nan_direction,nan_params,restart_error)AMICA/AMICAICA, save/load formats and the component-row conversion, the EEGLAB export and MNEapplypcakeep=20fit, the A-freeze iterations at the defaults, the MLXdevice/dtyperefusals, theLLtomission afterload, the params-table counts, and the raw PyTorch backend's automatic device choiceWhat changed
Concept pages
how-amica-works.mdwalks one iteration in the reference's order: E-step, the likelihood-decrease response and stopping checks, the exit before any update, then the update with the Newton start, the A-freeze windows (every fit, with or without sharing) and thedoscalingrescale; the false "each EM iteration increases the log-likelihood" is gone, andfinal_ll_atmax_iteris explainedamica-algorithm-flow.svgredrawn: the checks and the stop decision now come before the updatewhat-is-amica.mdcovers the unit-norm scale convention anddoscaling, and no longer claims bit-level parity;what-is-ica.mddefines ZCA and points to the EEGLAB guide for orderingGuides
do_newtonoff; only the bundledinput.paramturns it on), row 5 namessingular_ll, the backend table gainsvariance_order, scoring, wrapper and.ptsave rows, an obsolete comparison of two retired sharing metrics is replaced, theLLtexception names the last iterationAMICATorchNGraises), CUDA float32 is not faster, the native backend is listed, the wrappers' two backends and parameter-file route are statedget_mixing_matrixas scalp maps; the multi-model note still said the layout differs from the reference's (fixed by loadmodout reads W, sbeta and rho in the wrong byte order (corrupts genuine Fortran output) #159 and share_comps compares and merges the wrong vectors (all backends) #334)Entry pages and API
get_mixing_matrixscalp maps; the NumPy CLI takes either parameter formatAMICANative; extras install with uv; the NumPy page'sn_channelsclaim was wrong (the raw PyTorch and MLX constructors take it); the viz page no longer cites the closed loadmodout reads W, sbeta and rho in the wrong byte order (corrupts genuine Fortran output) #159 as openget_mixing_matrix/get_unmixing_matrixshapes and space;restart_error;maxdecscounts decreases, not consecutive ones; Newton's default; the raw backend's device default;shared componentwordingChangelog
Code
choose_pdf_type(no callers anywhere, includingbenchmarks/,examples/,scripts/) andcompute_pdf's unreachable legacy pdftype 2-4 branches with itspdftypeargument; every caller used the generalized Gaussian; no test existed only for themAgent context
AGENTS.mdmaps the shared modules (rank,schedule,initialization,component_layout,reference_constants,blocktune,restarts,fortran_params) andmne_compat/native/metrics, namesamica15.f90as the reference source, and states the epic's fitting changes.context/plan.mdand.context/progress_summary.mdrecord the epic and close stale release itemsGates
uv run ruff check .,uv run ruff format --check .,uv run ty check .,typosuv run mkdocs build --strictuv run pytest(full suite)