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 MLX backend (pamica.mlx_impl.AMICAMLXNG) has no explicit pcakeep / pcadb constructor parameters, while the torch backend (AMICATorchNG, torch_impl/core.py:619) supports them with Fortran semantics (numeigs = min(pcakeep, count(eigs > mineig))). On MLX, dimensionality reduction happens only through automatic numerical-rank detection (mineig / mineig_rel), as documented in mlx_impl/core.py around lines 2425-2433 and 3244-3246.
Use case
Standard EEGLAB preprocessing produces data whose rank is known exactly but is not always cleanly separable by an eigenvalue threshold: average reference (rank n-1), removed and later interpolated channels, and ASR-corrected segments. EEGLAB pipelines pass that rank explicitly (for example pcakeep = nbchan - 1 after average reference, as in the HBN pipeline), and the rank chosen should be identical across backends so MLX fits are comparable to torch and Fortran fits of the same data. We plan to run per-session AMICA on 64-channel BioSemi EEG (Alljoined1, 13 sessions) on Apple Silicon, where MLX is the fastest backend.
Request
Add pcakeep and pcadb to AMICAMLXNG with the same semantics and validation as AMICATorchNG, including the upfront _pca_reduction_requested() gate.
Cross-backend test: same data, same pcakeep, torch vs MLX sphere shape and component match within the existing tolerance.
Summary
The MLX backend (
pamica.mlx_impl.AMICAMLXNG) has no explicitpcakeep/pcadbconstructor parameters, while the torch backend (AMICATorchNG,torch_impl/core.py:619) supports them with Fortran semantics (numeigs = min(pcakeep, count(eigs > mineig))). On MLX, dimensionality reduction happens only through automatic numerical-rank detection (mineig/mineig_rel), as documented inmlx_impl/core.pyaround lines 2425-2433 and 3244-3246.Use case
Standard EEGLAB preprocessing produces data whose rank is known exactly but is not always cleanly separable by an eigenvalue threshold: average reference (rank n-1), removed and later interpolated channels, and ASR-corrected segments. EEGLAB pipelines pass that rank explicitly (for example
pcakeep = nbchan - 1after average reference, as in the HBN pipeline), and the rank chosen should be identical across backends so MLX fits are comparable to torch and Fortran fits of the same data. We plan to run per-session AMICA on 64-channel BioSemi EEG (Alljoined1, 13 sessions) on Apple Silicon, where MLX is the fastest backend.Request
pcakeepandpcadbtoAMICAMLXNGwith the same semantics and validation asAMICATorchNG, including the upfront_pca_reduction_requested()gate.pcakeep, torch vs MLX sphere shape and component match within the existing tolerance.AMICAwrapper once backend selection (Backend selection in the AMICA and AMICAICA wrappers #313) lands.Related: #304 (params-file surface for the NumPy and MLX backends), #322 (restoring the PCA residual with
pcakeep).