plot_pair_similarity

torchhd.utils.plot_pair_similarity(memory: Tensor, ax=None, **kwargs)[source]

Plots the pair-wise similarity of a hypervector set.

Parameters:
  • memory (Tensor) – The set of \(n\) hypervectors whose pair-wise similarity is to be displayed.

  • ax (matplotlib.axes, optional) – Axes in which to draw the plot.

  • **kwargsmatplotlib.axes.Axes.pcolormesh arguments.

Returns:

matplotlib.collections.QuadMesh.

Return type:

matplotlib.collections.QuadMesh

Shapes:
  • Memory: \((n, d)\)

Examples:

>>>  import matplotlib.pyplot as plt
>>>  hv = torchhd.level(10, 10000)
>>>  utils.plot_pair_similarity(hv)
>>>  plt.show()