EELSNMF is a Python library for the decomposition of Electron Energy Loss Spectroscopy (EELS) datasets using Non-negative Matrix Factorization (NMF).
The library implements and extends the mathematical logic described in:
Adrien Teurtrie et al, "Non-negative matrix factorization for spectroscopic data analysis", Mach. Learn.: Sci. Technol. 5 045050 (2024). DOI: 10.1088/2632-2153/ad9192.
While the original paper focuses on Energy-dispersive X-ray spectroscopy (EDX), this library adapts that logic specifically for EELS. It provides custom models for the
While the package is in development, you can install it directly from the source:
pip install git+https://github.com/PauTorru/EELSNMF.gitSpecific experimental functionalities are available as "extras". You can install them by appending the flags in brackets:
- GPU Support:
pip install "EELSNMF[gpu] @ git+https://github.com/PauTorru/EELSNMF.git"- EML data processing:
pip install "EELSNMF[EML] @ git+https://github.com/PauTorru/EELSNMF.git"- Torch Solvers:
install "EELSNMF[torch] @ git+https://github.com/PauTorru/EELSNMF.git"- Full Suite:
pip install "EELSNMF[all] @ git+https://github.com/PauTorru/EELSNMF.git"Multiple capabilities can be install with e.g. pip install "EELSNMF[EML,gpu] @ git+https://github.com/PauTorru/EELSNMF.git.
Note: If you are using ZSH (default on macOS), ensure you use quotes around the package name to avoid shell errors.
To begin, please refer to the Jupyter Notebook demo.ipynb. It provides a step-by-step guide the usage of the library.
This software is provided under a Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) license.
If you use this code in your research, please acknowledge the original work.
- -