Comparison with Other Libraries

Several Python libraries implement Self-Organizing Maps. They differ in technical architecture, maintenance, and built-in capabilities. The table below reproduces the comparison from the paper (Table 1); it is the basis for TorchSOM’s positioning.

Libraries compared: TorchSOM, MiniSom, SimpSOM, SOMPY, somoclu, and som-pbc.

Feature matrix

TorchSOM

MiniSom

SimpSOM

SOMPY

somoclu

som-pbc

Framework

PyTorch

NumPy

NumPy

NumPy

C++

NumPy

GPU acceleration

CUDA (PyTorch)

✗

CuPy / cuML

✗

CUDA C++

✗

JIT compilation

via PyTorch

Numba [1]

✗

✗

✗ (AOT) [2]

✗

API design

scikit-learn

Custom

Custom

MATLAB

Custom

Custom

Maintenance

Active

Active

Minimal

Minimal

Minimal

✗

Documentation

Rich

Basic [3]

Basic

✗

Basic

Basic

Test coverage

90%

98%

53%

✗

Minimal

✗

PyPI distribution

✓

✓

✓

✗

✓

✗

Visualization

Advanced

✗

Moderate

Moderate

Basic

Basic

Clustering (built-in)

✓

Examples only [4]

✓

✗

✗

✗

JITL support

✓

✗

✗

✗

✗

✗

SOM variants

Multiple [5]

✗

PBC

✗

PBC

PBC

Extensibility

High

Moderate

Low

Low

Low

Low

Where TorchSOM fits

Existing libraries each address a specific niche: MiniSom is a minimalist, NumPy-based implementation well suited to teaching and prototyping, while somoclu targets HPC environments through CUDA C++. TorchSOM is the only library in this comparison that combines, in a single modular codebase:

  • a native PyTorch backend with GPU acceleration,

  • a scikit-learn-compatible API,

  • an advanced built-in visualization suite,

  • a built-in clustering interface,

  • just-in-time-learning support, and

  • multiple grid topologies with configurable neighborhood retrieval modes.

It is further supported by this narrative documentation site and a community-oriented development process, making it a complete and scalable reference for both research and production. The performance side of this comparison — comparable quantization error, lower topographic error, and faster training on most workloads — is documented in Benchmarks.

Next steps