Expand description
§HOLOS — a fast, dependency-free Hyperdimensional Computing (HDC / VSA) engine.
HDC represents information as very high-dimensional vectors (~10,000-D) and computes with three cheap algebraic operations plus an associative memory:
- bind (
⊗): associate two hypervectors (XOR) — invertible, result orthogonal to both. - bundle (
⊕): superpose several (majority) — result similar to all of them. - permute (
ρ): rotate — encode order / sequences. - cleanup: nearest-neighbor search over an
ItemMemoryto decode a noisy result.
The flagship Hypervector uses the BSC (Binary Spatter Code) model, bit-packed into
u64 words so operations become XOR + hardware popcount — very fast and cache-friendly.
A bipolar map::MapVector model is also provided for tasks that favor linear bundling.
use holos_core::{Hypervector, Rng};
let mut rng = Rng::new(42);
let d = 10_000;
let role = Hypervector::random(d, &mut rng);
let value = Hypervector::random(d, &mut rng);
let bound = role.bind(&value); // associate role↔value
assert!(bound.bind(&role).similarity(&value) > 0.99); // unbind recovers valueModules§
- map
- MAP model (Multiply-Add-Permute, Gayler): bipolar
{-1, +1}hypervectors.
Structs§
- Classifier
- Accumulates a signed per-class vote at each bit position and builds prototypes (a prototype bit is 1 wherever the class’s vote is positive).
- Hypervector
- A binary hypervector (BSC model), bit-packed into 64-bit words.
- Item
Memory - A set of named hypervectors with fast nearest-neighbor search.
- Level
Encoder - Encodes fixed-length numeric feature vectors into hypervectors.
- Rng
- A tiny, fast, deterministic pseudo-random number generator (SplitMix64).