You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: torchhd/functional.py
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,8 @@ def identity_hv(
44
44
"""Creates a set of identity hypervector.
45
45
46
46
When bound with a random-hypervector :math:`x`, the result is :math:`x`.
47
+
48
+
Aliased as ``torchhd.identity_hv``.
47
49
48
50
Args:
49
51
num_embeddings (int): the number of hypervectors to generate.
@@ -93,6 +95,8 @@ def random_hv(
93
95
94
96
The resulting hypervectors are sampled uniformly at random from the ``embedding_dim``-dimensional hyperspace.
95
97
98
+
Aliased as ``torchhd.random_hv``.
99
+
96
100
Args:
97
101
num_embeddings (int): the number of hypervectors to generate.
98
102
embedding_dim (int): the dimensionality of the hypervectors.
@@ -153,6 +157,8 @@ def level_hv(
153
157
Implements level-hypervectors as an interpolation between random-hypervectors as described in `An Extension to Basis-Hypervectors for Learning from Circular Data in Hyperdimensional Computing <https://arxiv.org/abs/2205.07920>`_.
154
158
The first and last hypervector in the generated set are quasi-orthogonal.
155
159
160
+
Aliased as ``torchhd.level_hv``.
161
+
156
162
Args:
157
163
num_embeddings (int): the number of hypervectors to generate.
158
164
embedding_dim (int): the dimensionality of the hypervectors.
@@ -249,6 +255,8 @@ def circular_hv(
249
255
Implements circular-hypervectors based on level-hypervectors as described in `An Extension to Basis-Hypervectors for Learning from Circular Data in Hyperdimensional Computing <https://arxiv.org/abs/2205.07920>`_.
250
256
Any hypervector is quasi-orthogonal to the hypervector opposite site of the circle.
251
257
258
+
Aliased as ``torchhd.circular_hv``.
259
+
252
260
Args:
253
261
num_embeddings (int): the number of hypervectors to generate.
254
262
embedding_dim (int): the dimensionality of the hypervectors.
shifts (int or tuple of ints, optional): The number of places by which the elements of the tensor are shifted. If shifts is a tuple, dims must be a tuple of the same size, and each dimension will be rolled by the corresponding value.
0 commit comments