VSATensor

class torchhd.VSATensor[source]

Base class

Each model must implement the methods specified on this base class.

bind(other: VSATensor) VSATensor[source]

Bind the hypervector with other

bundle(other: VSATensor) VSATensor[source]

Bundle the hypervector with other

cosine_similarity(others: VSATensor) Tensor[source]

Cosine similarity with other hypervectors

dot_similarity(others: VSATensor) Tensor[source]

Inner product with other hypervectors

classmethod empty(num_vectors: int, dimensions: int, *, dtype=None, device=None) VSATensor[source]

Creates hypervectors representing empty sets

classmethod identity(num_vectors: int, dimensions: int, *, dtype=None, device=None) VSATensor[source]

Creates identity hypervectors for binding

inverse() VSATensor[source]

Inverse the hypervector for binding

multibind() VSATensor[source]

Bind multiple hypervectors

multibundle() VSATensor[source]

Bundle multiple hypervectors

negative() VSATensor[source]

Negate the hypervector for the bundling inverse

normalize() VSATensor[source]

Normalize the hypervector

permute(shifts: int = 1) VSATensor[source]

Permute the hypervector

classmethod random(num_vectors: int, dimensions: int, *, dtype=None, device=None, generator=None) VSATensor[source]

Creates random or uncorrelated hypervectors