bundle_sequence
- torchhd.bundle_sequence(input: VSATensor) VSATensor[source]
Bundling-based sequence.
The first value is permuted \(n-1\) times, the last value is not permuted.
\[\bigoplus_{i=0}^{n-1} \Pi^{n - i - 1}(V_i)\]- Parameters:
input (VSATensor) – The hypervector values.
- Shapes:
Input: \((*, n, d)\)
Output: \((*, d)\)
Examples:
>>> x = torchhd.random(4, 6) >>> x tensor([[ 1., -1., 1., 1., 1., 1.], [-1., 1., -1., -1., 1., -1.], [ 1., 1., -1., -1., -1., 1.], [-1., -1., 1., -1., 1., 1.]]) >>> torchhd.bundle_sequence(x) tensor([ 2., 0., 2., 0., -2., 0.])