Skip to content

tinytopics

PyPI version Python versions CI tests Mypy check Ruff check Documentation License

Topic modeling via sum-to-one constrained neural Poisson NMF. Built with PyTorch, runs on both CPUs and GPUs.

Installation

Using pip

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 .

For a more robust package management experience, use uv to manage tinytopics as a project dependency.

Add tinytopics and PyTorch to your project:

uv add tinytopics torch torchvision

To install PyTorch with GPU support (for example, Windows with CUDA 13.0), configure pyproject.toml:

[tool.uv.sources]
torch = [{ index = "pytorch-cu130", marker = "sys_platform == 'win32'" }]
torchvision = [{ index = "pytorch-cu130", marker = "sys_platform == 'win32'" }]

[[tool.uv.index]]
name = "pytorch-cu130"
url = "https://download.pytorch.org/whl/cu130"
explicit = true

Then sync your environment:

uv sync

For other platforms and accelerators (CPU-only, ROCm, Intel GPUs), see Using uv with PyTorch.

Examples

After tinytopics is installed, try examples from: