multibind

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

多个超向量的绑定。

将所有输入的超向量绑定在一起。

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

input (VSATensor) – 输入的超向量张量。

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

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

示例:

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