Metadata-Version: 2.3
Name: tinytopics
Version: 0.1.3
Summary: Topic modeling via sum-to-one constrained Poisson non-negative matrix factorization
Project-URL: Homepage, https://nanx.me/tinytopics/
Project-URL: Documentation, https://nanx.me/tinytopics/
Project-URL: Repository, https://github.com/nanxstats/tinytopics
Project-URL: Issues, https://github.com/nanxstats/tinytopics/issues
Project-URL: Changelog, https://github.com/nanxstats/tinytopics/blob/main/CHANGELOG.md
Author-email: Nan Xiao <me@nanx.me>
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.9
Requires-Dist: matplotlib>=3.8.4
Requires-Dist: numpy>=2.0.0
Requires-Dist: scipy>=1.13.0
Requires-Dist: torch>=2.3.0
Requires-Dist: tqdm>=4.65.0
Description-Content-Type: text/markdown

# tinytopics <img src="docs/assets/logo.png" align="right" width="120" />

[![PyPI version](https://img.shields.io/pypi/v/tinytopics)](https://pypi.org/project/tinytopics/)
![License](https://img.shields.io/pypi/l/tinytopics)
![Python versions](https://img.shields.io/pypi/pyversions/tinytopics)

Topic modeling via sum-to-one constrained Poisson non-negative
matrix factorization, built with PyTorch, runs on both CPUs and GPUs.

## Installation

You can install tinytopics from PyPI:

```bash
pip3 install tinytopics
```

Or install the development version from GitHub:

```bash
git clone https://github.com/nanxstats/tinytopics.git
cd tinytopics
python3 -m pip install -e .
```

## GPU support

The above will install the CPU version of PyTorch by default. To enable GPU support,
follow the [PyTorch official guide](https://pytorch.org/get-started/locally/)
to install the appropriate PyTorch version.

For example, to install PyTorch for Windows with CUDA 12.4:

```bash
pip3 uninstall torch
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
```

To manage the PyTorch dependency under a project context using virtual
environments, you might want to set up manual sources. For example,
[using Rye](https://rye.astral.sh/guide/faq/#how-do-i-install-pytorch).

## Get started

After tinytopics is installed, try the example from the
[getting started guide](https://nanx.me/tinytopics/articles/get-started/)
or see the [speed benchmark](https://nanx.me/tinytopics/articles/benchmark/).

## License

MIT
