bind_sequence

torchhd.bind_sequence(input: VSATensor) VSATensor[来源]

基于绑定的序列。

第一个值被排列了\(n-1\)次,最后一个值没有被排列。

\[\bigotimes_{i=0}^{n-1} \Pi^{n - i - 1}(V_i)\]
Parameters:

input (VSATensor) – 超向量值。

Shapes:
  • 输入: \((*, n, d)\)

  • 输出: \((*, d)\)

示例:

>>> 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.bind_sequence(x)
tensor([-1., -1., -1., -1.,  1., -1.])