![]() |
Deepity
Ultra-fast, SIMD-accelerated Predictive Coding
|
Deepity is a Predictive Coding (PC) library engineered from the ground up for zero-overhead, ultra-low-variance inference and learning. It is aggressively CPU-optimized to extract maximum throughput from modern hardware, with a CUDA backend currently in development.
This page is the entry point into the API reference. For build instructions, benchmarks, and contribution guidelines, see the GitHub README.
Deepity implements Predictive Coding Networks (PCNs) as an alternative to standard backpropagation-based training. The library is written in C++20, uses custom AVX2/AVX-512 SIMD kernels for activation functions, and packs layer buffers into a single contiguous memory arena for cache locality. A nanobind-based Python extension (pydeepity) exposes the same native engine to Python with negligible overhead.
The DiscriminativePCNetwork class manages layer hierarchies, bidirectionality, and dynamic thread scaling based on batch size automatically:
The same engine is available from Python via the compiled pydeepity extension module. Runnable examples live in examples/, including examples/xor.py (minimal training loop) and examples/train_mnist_deep.py (end-to-end MNIST training).
Top-level network abstractions, each managing a layer stack and the predictive-coding relaxation loop:
All layers derive from a common Layer base:
On a 12th Gen Intel Core i7-12700H, Deepity sustains roughly 123 GFLOPS during predictive-coding inference and learning when compiled with Clang (LLVM), via custom SIMD micro-kernels, 64-byte-aligned buffers, and a contiguous memory arena. Full benchmark methodology and GCC-vs-Clang comparisons are in the README.