Topic modeling via sum-to-one constrained neural Poisson NMF. Built with PyTorch, runs on both CPUs and GPUs.
You can install tinytopics from PyPI:
pip install tinytopics
Or install the development version from GitHub:
git clone https://github.com/nanxstats/tinytopics.git cd tinytopics python3 -m pip install -e .
The above will likely install the CPU version of PyTorch by default. To install PyTorch with GPU support, follow the official guide.
For example, install PyTorch for Windows with CUDA 12.6:
pip uninstall torch pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126
For users stuck with older PyTorch or NumPy versions, for instance, in HPC cluster settings, a workaround is to skip installing the dependencies with --no-deps
and install specific versions of all dependencies manually:
pip install tinytopics --no-deps pip install torch==2.2.0
To have a more hassle-free package management experience, it is recommended to use tinytopics as a dependency under a project context using virtual environments.
You should probably set up a manual source/index for PyTorch. As examples, check out the official guidelines when using Rye or using uv.
After tinytopics is installed, try examples from: