hyperdimensional-computing / torchhd

Torchhd is a Python library for Hyperdimensional Computing and Vector Symbolic Architectures
https://torchhd.readthedocs.io
MIT License
233 stars 24 forks source link

Previous value passing in Structures design #62

Open mikeheddes opened 2 years ago

mikeheddes commented 2 years ago

This issue is to discuss design improvements around the access to the exact previous hypervector value in the data structures. Right now we require the user to pass the previous version for every mutation method. We can think of designs to provide this behavior. For instance:

hv = torchhd.random_hv(10, 10000)
S = torchhd.structures.Sequence.from_tensor(hv)
S.replace(2, hv[2], hv[5])

Could be:

hv = torchhd.random_hv(10, 10000)
S = torchhd.structures.Sequence.from_tensor(hv)
S.replace(2, hv[5])  # not passing the old value

however this requires the data structure to have access to the exact hypervector. The discussion here is how to implement that in a way that give ample freedom to the user to experiment with various cleanup memories.