Skip to main content

Crate genhdc

Crate genhdc 

Source
Expand description

§GenHDC — Genetic Hyperdimensional Computing

GenHDC is a Rust crate for Hyperdimensional Computing (HDC) / Vector Symbolic Architectures (VSA) plus genetic operators on concept genomes.

The HDC engine (HdcEngine) was extracted from Mimer, a continuously running production Rust agent. It provides 10 000-dimensional bipolar vectors with bind, bundle, unbind, and permutation.

The genetic layer (ConceptGenome) adds inheritance, mutation, CRISPR-like targeted editing, and epigenetic expression — sitting on top of any HDC representation.

§Quick start (HDC)

use genhdc::{HdcEngine, DIMENSIONS};

let mut hdc = HdcEngine::with_seed(DIMENSIONS, 42);
let a = hdc.encode("apple");
let b = hdc.encode("color");
let bound = hdc.bind(&a, &b);
let recovered = hdc.unbind(&bound, &b);
assert!(hdc.similarity(&recovered, &a) > 0.9);

§Quick start (genetic layer)

use genhdc::ConceptGenome;

let apple = ConceptGenome::primordial("apple", 0);
let snake = ConceptGenome::primordial("snake", 0);
let eats = ConceptGenome::inherit(&snake, &apple, "eats", 1);
assert_eq!(eats.generation, 1);

Re-exports§

pub use genome::ConceptGenome;
pub use genome::GenomeFeature;
pub use hdc::is_hdc_sentinel;
pub use hdc::is_vocab_rejected;
pub use hdc::pack_bipolar;
pub use hdc::unpack_bipolar;
pub use hdc::vocab_reject_reason;
pub use hdc::vocab_rejected_totals;
pub use hdc::HdcEngine;
pub use hdc::VocabRejectReason;
pub use hdc::VocabRejectTotals;
pub use hdc::DIMENSIONS;

Modules§

genome
Core genome types and genetic operators for GenHDC.
hdc
Hyperdimensional Computing / Vector Symbolic Architecture engine.
seeds
Minimal semantic seed poles used to warm a fresh crate::HdcEngine.