Skip to content

Unify the lrate default and fix raw-backend device auto-selection #354

Closed

Description

@neuromechanist

Three default-behavior fixes that the documentation audit (#352) surfaced. They belong to epic #324 because its release already changes default fits.

Scope

  1. One lrate default across entry points.

    • Today the AMICA wrapper defaults to lrate=0.05, the value in EEGLAB's runamica15.m. AMICATorchNG, AMICAMLXNG and AMICA_NumPy default to 0.1, the compiled amica15 default (amica15_header.f90:68). Every other pamica default also follows the compiled binary.
    • So AMICA().fit(X) and AMICATorchNG(n).fit(X) run different learning rates. User decision (2026-09-23): unify on 0.1.
    • The wrapper takes the default from the backend rather than restating it, and AMICAICA inherits it.
    • An explicit or params-file lrate is unaffected. Tests that relied on the wrapper's implicit 0.05 set it explicitly or move to the new default.
  2. Raw AMICATorchNG auto device choice.

    • AMICATorchNG(n_channels=4) with default arguments raises ValueError on every Apple Silicon Mac: auto-selection picks MPS, which cannot represent the float64 default.
    • The AMICA wrapper already falls back to CPU in that case. Move that fallback into the backend so there is one implementation, with a log message.
    • An explicit device="mps" at float64 still raises.
    • Covered by a test that runs on the macOS CI runner.
  3. Dead package data. Remove the package-data entry "pamica" = ["data/*"] from pyproject.toml, which names a directory that does not exist.

  4. Documentation. docs/guides/amica-differences.md gains a defaults table covering pamica, the compiled amica15 binary and EEGLAB's runamica15.m, and says how to reproduce an EEGLAB run: the bundled input.param through from_params_file. The table includes:

    • pdftype (compiled 1; pamica and runamica15.m 0);
    • do_newton, lrate, maxdecs, newt_start, newtrate, minlrate, invsigmin/invsigmax, mineig, rholratefact, block_size and max_iter.

    Also update the changelog and the pages that describe the wrapper's lrate or the raw backend's device behavior.

Part of epic #324.

Activity

  1. added
    bug
    on Sep 23, 2026
  2. neuromechanist commented on Sep 24, 2026

    @neuromechanist
    MemberAuthor

    Scope additions (2026-09-23), both following the user's decision that every pamica entry point shares one default set:

    • AMICA_NumPy's default params.json sets do_newton true and max_iter 2000, while PyTorch and MLX default to Newton off and 100 iterations. Align it.
    • AMICANative defaults to the bundled input.param values (lrate 0.05, Newton on, max_iter 2000, block_size 512). User decision: it moves to the shared set, so default runs of pamica and of the reference binary are directly comparable. Callers whose protocol depends on the old values pin them explicitly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions