TorchSOM is the official code for
paper PAPER ARTICLE AND LINK TO UPDATE, @CONFERENCE @DATE.
It provides an efficient and scalable implementation of Self-Organizing Maps (SOMs) using PyTorch, making it easy to integrate with deep learning workflows while benefiting from GPU acceleration.
TorchSOM is a PyTorch-based library for training Self-Organizing Maps (SOMs), a type of unsupervised learning algorithm used for clustering and dimensionality reduction. Designed for scalability and ease of use, this implementation is optimized for large-scale data.
Also, this repository is highly documented and commented, which makes it easy to use, understand, deploy, and which offers endless possibilities for improvements.
To help you explore and experiment with TorchSOM, we provide Jupyter notebooks in the notebooks/
directory. There are multiples datasets and the corresponding results respectively in the data/
and results/
directories.
iris.ipynb
: A multiclass classification example.wine.ipynb
: Another multiclass classification example.boston_housing.ipynb
: A regression example.energy_efficiency.ipynb
: A multi-regression example.get_data.ipynb
: The notebook used to generated the datasets provided in thedata/
directory.
If you find this project interesting, we would be grateful for your support by starring ⭐ this GitHub repository
.
You can install the package using PyPI (not available yet):
pip install torchsom
If you want to use the latest version, or if you prefer the command line interface, you can use it locally by cloning or forking this repository to your local machine. TorchSOM requires a recent version of Python, preferably 3.9 or higher.
git clone https://github.com/LouisTier/TorchSOM.git
If you want to develop the package and run the notebooks after cloning the repository, make sure you have the required dependencies installed before using it:
python3.9 -m venv .torchsom_env # Create a virtual environment
source .torchsom_env/bin/activate # Activate the environment
pip install -e '.[dev]' # Install the required dependencies
If you use TorchSOM in your research or work, please consider citing it using the following entries:
-
Paper
@inproceedings{Berthier2025TorchSOM_paper, title = {{TorchSOM: A Scalable PyTorch-Compatible Library for Self-Organizing Maps}}, author = {Berthier, Louis}, year = {2025}, }
-
Software
@software{Berthier2025TorchSOM_software, author = {Berthier, Louis}, title = {{TorchSOM: A Scalable PyTorch-Compatible Library for Self-Organizing Maps}}, year = {2025}, url = {https://github.com/LouisTier/TorchSOM}, license = {Apache-2.0}, }
For more details, please refer to the CITATION.cff
file.
The Centre de Mathématiques Appliquées - CMAP - at the Ecole Polytechnique - X -, and Manufacture Française des Pneumatiques Michelin for the joint collaboration and supervision during my PhD thesis.
Giuseppe Vettigli for his GitHub repository MiniSom, which provided a first well-maintained and open-source implementation of Self-Organizing Maps.
Logo created using DALL-E.
We invite contributors of all backgrounds and experience levels to get involved and contribute to this library. Whether you have innovative ideas to propose or are eager to submit pull requests, we encourage your contributions!
Please take a moment to read our Code of Conduct
if you're interested in contributing.
TorchSOM is licensed under the Apache License, Version 2.0. Feel free to use and modify the code as per the terms of the LICENSE
.
- Related Papers:
- Self-Organizing Maps by Teuvo Kohonen, 2001
- An Introduction to Self-Organizing Maps by Umut Asan & Secil Ercan, 2012
- Brief Review of Self-Organizing Maps by Dubravko Miljković, 2017
- Code Inspiration:
Built upon concepts from MiniSom by Giuseppe Vettigli - Repository Structure:
Organized following the CCSD format by Adrien Carrel