bayes-hdc

Probabilistic hyperdimensional computing in JAX.

bayes-hdc is a JAX library for hyperdimensional computing (HDC) with a probabilistic layer on top — PVSA, Probabilistic Vector Symbolic Architectures. Every hypervector is an element of a small, well-designed algebra: a commutative binding, an associative bundling, a cyclic group action, a cosine measure, and a posterior distribution over the whole thing. Every type is a JAX pytree, so jit, vmap, grad, pmap, and shard_map compose with every operation.

30-second tour

Construct a GaussianHV, propagate moments through bind and bundle, and read off expected cosine similarity — closed form, no Monte Carlo.

Quick Start
PVSA primitives

GaussianHV, DirichletHV, MixtureHV with closed-form moments and KL divergences. Reparameterisation gradients everywhere.

API reference
Coverage guarantees

ConformalClassifier returns prediction sets with marginal coverage ≥ 1 − α on exchangeable data. TemperatureCalibrator fits the convex MLE temperature.

API reference
Group structure

The cyclic-shift action of \(\mathbb{Z}/d\) is first-class. Property-based verifiers reject ops claiming a symmetry they do not have.

API reference
8 VSA models

BSC, MAP, HRR, FHRR, BSBC, CGR, MCR, VTB — uniform bind / bundle / inverse / similarity / random API.

VSA Models
Scales out

pmap_bind_gaussian, shard_map_bind_gaussian, shard_classifier_posteriors for pod-scale training.

API reference

Install

pip install -e .                # core
pip install -e ".[examples]"    # + matplotlib + scikit-learn
pip install -e ".[dev]"         # + pytest, ruff, mypy

Status

Alpha. Versions 0.2 through 1.0 shipped — Gaussian and Dirichlet posteriors, conformal prediction, temperature calibration, probabilistic resonator, posterior predictive checks, streaming Bayesian updates, multi-device sharding, 11 standard HDC datasets, and equivariance verifiers. 480 tests, 97 % line coverage, Ubuntu + macOS × Python 3.9–3.13 on every push.

The public API may shift before 1.0; behaviour changes are called out in CHANGELOG.md.


User guide

API reference

Project

Indices