Skip to content

GPU-accelerated topic modeling via sum-to-one constrained neural Poisson NMF with PyTorch

License

Notifications You must be signed in to change notification settings

nanxstats/tinytopics

Repository files navigation

tinytopics

PyPI version Python versions CI Tests mkdocs PyPI Downloads 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 .

Install PyTorch with GPU support

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

Install alternative PyTorch versions

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

Use tinytopics in a project

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.

Examples

After tinytopics is installed, try examples from:

About

GPU-accelerated topic modeling via sum-to-one constrained neural Poisson NMF with PyTorch

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages