negative

torchhd.negative(input: VSATensor) VSATensor[source]

Inverse for the bundling operation.

See bundle().

Parameters:

input (VSATensor) – input hypervector

Shapes:
  • Input: \((*)\)

  • Output: \((*)\)

Examples:

>>> a = torchhd.random(1, 10)
>>> a
tensor([[ 1.,  1., -1.,  1.,  1.,  1.,  1., -1.,  1.,  1.]])
>>> torchhd.negative(a)
tensor([[-1., -1.,  1., -1., -1., -1., -1.,  1., -1., -1.]])