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

n-gram Experiment #35

Closed aglinxinyuan closed 2 years ago

aglinxinyuan commented 2 years ago

random_hv(10, 10000) ngrams_base: 134 µs ± 4.1 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each) ngrams_unbind: 262 µs ± 9.69 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each) ngrams_forloop: 132 µs ± 3.62 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each) ngrams_in_place: 122 µs ± 1.74 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each) ngrams_index_select: 162 µs ± 2.18 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)

mikeheddes commented 2 years ago

Thank you for the results, I'm going to close the PR now since I don't think we need this example in the repo.