torchhd
This module consists of the basic hypervector generation functions and operations used on hypervectors.
Basis-hypervector sets
|
Creates a set of hypervectors representing empty sets. |
|
Creates a set of identity hypervectors. |
|
Creates a set of random independent hypervectors. |
|
Creates a set of level correlated hypervectors. |
|
Creates a thermometer code for given dimensionality. |
|
Creates a set of circularly correlated hypervectors. |
Operations
|
Binds two hypervectors which produces a hypervector dissimilar to both. |
|
Bundles two hypervectors which produces a hypervector maximally similar to both. |
|
Permutes hypervector by specified number of shifts. |
|
Inverse for the binding operation. |
|
Inverse for the bundling operation. |
|
Gets the most similar hypervector in memory. |
|
Bundles two hypervectors by selecting random elements. |
|
Bundling multiple hypervectors by sampling random elements. |
Creates random permutation functions. |
|
|
A step of the resonator network that factorizes the input. |
|
Compute weights (readout matrix) with ridge regression. |
|
Applies the hyperbolic tanh function to all elements of the input tensor. |
|
Applies binary quantization to all elements of the input tensor. |
Similarities
|
Cosine similarity between the input vector and each vector in others. |
|
Dot product between the input vector and each vector in others. |
|
Hamming similarity is the number of equal elements between the input vectors and each vector in others. |
Encodings
|
Multiset of input hypervectors. |
|
Binding of multiple hypervectors. |
|
Bundling-based sequence. |
|
Binding-based sequence. |
|
Hash table from keys-values hypervector pairs. |
|
Cross product between two sets of hypervectors. |
|
Creates a hypervector with the \(n\)-gram statistics of the input. |
|
Graph from node hypervector pairs. |
VSA Models
Base class |
|
Binary Spatter Codes |
|
Multiply Add Permute |
|
Holographic Reduced Representation |
|
Fourier Holographic Reduced Representation |
|
Binary Sparse Block Codes (B-SBC) |
|
Vector-Derived Transformation Binding |
Utilities
|
Converts data into a VSA model tensor. |
|
Maps the input real value range to an output real value range. |
|
Maps the input real value range to an index range. |
|
Maps the input index range to a real value range. |