API reference

This page is the canonical entry point for the public API. Detailed signatures live in the per-module pages (Functional Module, VSA Models, Embeddings Module, Models Module, Memory Module, Utilities Module); this page is the high-level index.

PVSA — probabilistic primitives

bayes_hdc.GaussianHV(mu, var, dimensions)

A hypervector distributed as \(\mathcal{N}(\mu, \mathrm{diag}(\sigma^2))\).

bayes_hdc.DirichletHV(alpha, dimensions)

A Dirichlet distribution over the probability simplex \(\Delta_K\).

bayes_hdc.MixtureHV(weights, mu, var, dimensions)

A mixture-of-Gaussian posterior over hypervectors.

bayes_hdc.bind_gaussian(x, y)

Bind two independent Gaussian HVs under element-wise multiplication.

bayes_hdc.bundle_gaussian(hvs)

Bundle a batch of independent Gaussian HVs by summation.

bayes_hdc.permute_gaussian(x[, shifts])

Cyclically permute a Gaussian hypervector.

bayes_hdc.cleanup_gaussian(query, memory)

Retrieve the entry in memory most similar to query.

bayes_hdc.cleanup_gaussian_stacked(query, memory)

JIT-friendly cleanup against a stacked memory of Gaussian hypervectors.

bayes_hdc.inverse_gaussian(x[, eps])

Approximate inverse of a Gaussian HV under element-wise product binding.

bayes_hdc.expected_cosine_similarity(x, y)

Plug-in estimator of the expected cosine similarity under p(x) p(y).

bayes_hdc.similarity_variance(x, y)

First-order variance of the dot product \(\langle X, Y \rangle\).

bayes_hdc.kl_gaussian(p, q)

KL divergence \(\mathrm{KL}(p \| q)\) for two diagonal Gaussians.

bayes_hdc.bind_dirichlet(x, y)

Bind two Dirichlet HVs by element-wise mean product, re-normalised.

bayes_hdc.bundle_dirichlet(hvs)

Bundle a batch of Dirichlet HVs by summing concentrations.

bayes_hdc.kl_dirichlet(p, q)

Closed-form KL divergence \(\mathrm{KL}(p \| q)\) for two Dirichlets.

Bayesian classifiers

bayes_hdc.BayesianCentroidClassifier(mu, ...)

Gaussian-posterior classifier — one GaussianHV per class.

bayes_hdc.BayesianAdaptiveHDC(mu, var[, ...])

Streaming Gaussian-posterior classifier with Kalman updates.

bayes_hdc.StreamingBayesianHDC(mu, var[, ...])

Bounded-memory streaming classifier with exponential decay.

Uncertainty quantification

bayes_hdc.TemperatureCalibrator(temperature)

Temperature scaling for post-hoc classifier calibration.

bayes_hdc.ConformalClassifier(threshold[, alpha])

Split-conformal wrapper — prediction sets with coverage guarantee.

bayes_hdc.posterior_predictive_check(...[, ...])

Compare an observed statistic to its posterior-predictive distribution.

bayes_hdc.coverage_calibration_check(...[, ...])

Audit conformal-predictor coverage across a grid of \(\alpha\).

Group-theoretic structure

bayes_hdc.shift(x, k)

Apply the \(\mathbb{Z}/d\) cyclic-shift action T_k to x.

bayes_hdc.compose_shifts(j, k, d)

Compose two shifts in \(\mathbb{Z}/d\).

bayes_hdc.hrr_equivariant_bilinear(x, filter_hv)

The canonical single-argument shift-equivariant bilinear operator.

bayes_hdc.verify_shift_equivariance(fn, *args)

Check whether fn commutes with the diagonal \(\mathbb{Z}/d\) action.

bayes_hdc.verify_single_argument_shift_equivariance(fn, ...)

Check whether fn is shift-equivariant in a single argument.

bayes_hdc.verify_shift_invariance(fn, *args)

Check whether fn is invariant under the diagonal \(\mathbb{Z}/d\) action.

Inference helpers

bayes_hdc.elbo_gaussian(posterior, prior, ...)

Evidence lower bound for a Gaussian-posterior PVSA model.

bayes_hdc.reconstruction_log_likelihood_mc(...)

Mean cosine similarity between posterior samples and the target.

bayes_hdc.probabilistic_resonator(codebooks, ...)

Multi-restart MCMC factorisation of a composite PVSA hypervector.

Multi-device

bayes_hdc.distributed.pmap_bind_gaussian(x, y)

Bind two sharded Gaussian hypervector batches across devices.

bayes_hdc.distributed.pmap_bundle_gaussian(hvs)

Bundle a sharded batch of Gaussian hypervectors across devices.

bayes_hdc.distributed.shard_map_bind_gaussian(x, y)

shard_map-based bind for multi-accelerator pods (JAX ≥ 0.4.24).

bayes_hdc.distributed.shard_classifier_posteriors(mu, var)

Reshape (K, d) class posteriors into (n_devices, K // n_devices, d).

Classical VSA models

bayes_hdc.MAP(name, dimensions)

Multiply-Add-Permute (MAP) coding.

bayes_hdc.BSC(name, dimensions)

Binary Spatter Codes (BSC).

bayes_hdc.HRR(name, dimensions)

Holographic Reduced Representations (HRR).

bayes_hdc.FHRR(name, dimensions)

Fourier Holographic Reduced Representations (FHRR).

bayes_hdc.BSBC(name, dimensions[, ...])

Binary Sparse Block Codes (B-SBC).

bayes_hdc.CGR(name, dimensions[, q])

Cyclic Group Representation (CGR).

bayes_hdc.MCR(name, dimensions[, q])

Modular Composite Representation (MCR).

bayes_hdc.VTB(name, dimensions)

Vector-Derived Transformation Binding (VTB).

See Functional Module, VSA Models, Embeddings Module, Models Module, Memory Module, and Utilities Module for full per-module documentation including method signatures, return types, and docstrings.