multiset
- torchhd.multiset(input: VSATensor) VSATensor[source]
Multiset of input hypervectors.
Bundles all the input hypervectors together.
\[\bigoplus_{i=0}^{n-1} V_i\]Note
This operation does not normalize the resulting or intermediate hypervectors. Normalized hypervectors can be obtained with
normalize().- Parameters:
input (VSATensor) – input hypervector tensor
- Shapes:
Input: \((*, n, d)\)
Output: \((*, d)\)
Examples:
>>> x = torchhd.random(3, 6) >>> x tensor([[-1., -1., 1., -1., 1., -1.], [-1., 1., -1., 1., -1., 1.], [-1., -1., 1., -1., 1., -1.]]) >>> torchhd.multiset(x) tensor([-3., -1., 1., -1., 1., -1.])