Skip to main content

Native Python implementation of AMICA for MNE-Python and scientific EEG workflows.

Project description

amica

CI Docs Codecov PyPI - Version Python Versions License

amica is a native Python implementation of AMICA (Adaptive Mixture Independent Component Analysis), one of the highest-performing ICA algorithms for EEG source separation.

Originally distributed as a closed-source Fortran executable from UCSD, this implementation of amica provides an open, extensible implementation with optional JAX acceleration, seamless MNE-Python integration, and a modern Python API for reproducible neuroimaging workflows.

Status: amica is under active development and validation. The implementation already achieves numerical agreement with the original MATLAB AMICA across a broad range of configurations, while documentation and benchmarking continue to expand.


Highlights

  • Native Python implementation of the AMICA algorithm
  • Numerical agreement with the original MATLAB AMICA implementation
  • Optional JAX backend for CPU and GPU acceleration
  • Native integration with MNE-Python
  • Support for multi-model AMICA
  • Modern scientific Python API
  • Extensive testing and continuous integration
  • Fully open source (BSD-3-Clause)

Installation

Using pip

git clone https://github.com/snesmaeili/amica.git
cd amica
pip install -e .

Install optional dependencies:

pip install -e ".[jax]"
pip install -e ".[mne]"
pip install -e ".[dev]"
pip install -e ".[all]"

Using uv

git clone https://github.com/snesmaeili/amica.git
cd amica

uv venv
source .venv/bin/activate

uv pip install -e .

or

uv pip install -e ".[all]"

Quick Start

from amica import Amica, AmicaConfig

config = AmicaConfig(
    max_iter=2000,
    num_mix_comps=3,
)

model = Amica(config, random_state=42)

result = model.fit(data)

sources = model.transform(data)

For MNE-Python:

from amica import fit_ica

ica = fit_ica(raw)

ica.plot_components()
ica.apply(raw)

Examples

Example scripts are available in the examples/ directory, including:

  • MNE-Python integration
  • Native AMICA API
  • JAX acceleration
  • Multi-model AMICA
  • HPC / SLURM execution

Documentation

Full documentation, API reference, validation experiments, and tutorials are available at

https://snesmaeili.github.io/amica/


Validation

amica has been validated against the original MATLAB AMICA implementation and achieves numerical agreement across a wide range of configurations.

The documentation contains:

  • validation experiments
  • numerical parity analyses
  • performance benchmarks
  • reproducibility instructions

Contributing

Contributions are welcome!

Please read CONTRIBUTING.md before opening a pull request.


Citation

If amica contributes to your research, please cite the original AMICA publications.

Citation metadata is available in CITATION.cff.


License

amica is distributed under the terms of the BSD 3-Clause License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

amica-0.0.1.tar.gz (91.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

amica-0.0.1-py3-none-any.whl (66.5 kB view details)

Uploaded Python 3

File details

Details for the file amica-0.0.1.tar.gz.

File metadata

  • Download URL: amica-0.0.1.tar.gz
  • Upload date:
  • Size: 91.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for amica-0.0.1.tar.gz
Algorithm Hash digest
SHA256 cc614a33882a486a69d075ac74186a16d9af35db1d30cac0abf992ac7e3ae363
MD5 17e5c22d33ab20c471e9292ff7aaeaeb
BLAKE2b-256 29345799e01d9052acc354c1c4a66978a09ccd70fdd1181aed9a1bdc1ee2907e

See more details on using hashes here.

Provenance

The following attestation bundles were made for amica-0.0.1.tar.gz:

Publisher: release.yml on snesmaeili/amica

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file amica-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: amica-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 66.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for amica-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0ce5897f75aab3a631d640ed97f9e129edafd262db5d75bb002183c06debafc9
MD5 36e00db9269384b0d0e79bd41952476a
BLAKE2b-256 0a9292cd06ce4689fa95e496658cca5588d7768ffad664a3e67d40150615c570

See more details on using hashes here.

Provenance

The following attestation bundles were made for amica-0.0.1-py3-none-any.whl:

Publisher: release.yml on snesmaeili/amica

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page