Pyromancy Documentation

Pyromancy is a compact library for predictive coding built on top of PyTorch.

Installation

Pyromancy is available as a package on PyPI and can be installed as follows.

pip install pyromancy-ai

By default, this installs the torch and torchvision packages with only CPU support (Linux/Windows) or support for CPU and MPS (macOS). To include support for CUDA or ROCm, a corresponding extra-index-url must be specified.

pip install pyromancy-ai --extra-index-url https://download.pytorch.org/whl/cu128

Installing with this command includes support for CPU and for CUDA 12.8. The installation options can be found on PyTorch’s getting started page.

Getting Started

See the example, Classifying MNIST with a Hierarchical PCN, for a complete worked-out example of how to build and train a predictive coding network.

License

Pyromancy is distributed under the terms of the BSD-3-Clause license.