Onlinehd
Efficient single-pass hyperdimensional classifier. Mirror of https://gitlab.com/biaslab/onlinehd
Install / Use
/learn @BIASLab-UCI/OnlinehdREADME
onlinehd
Authors: Alejandro Hernández Cano, Mohsen Imani.
Installation
In order to install the package, simply run the following:
pip install onlinehd
Visit the PyPI project page for more information about releases.
Documentation
Read the documentation of this project.
Quick start
The following code generates dummy data and trains a OnlnineHD classification model with it.
>>> import onlinehd
>>> dim = 10000
>>> n_samples = 1000
>>> features = 100
>>> classes = 5
>>> x = torch.randn(n_samples, features) # dummy data
>>> y = torch.randint(0, classes, [n_samples]) # dummy data
>>> model = onlinehd.OnlineHD(classes, features, dim=dim)
>>> if torch.cuda.is_available():
... print('Training on GPU!')
... model = model.to('cuda')
... x = x.to('cuda')
... y = y.to('cuda')
...
Training on GPU!
>>> model.fit(x, y, epochs=10)
>>> ypred = model(x)
>>> ypred.size()
torch.Size([1000])
For more examples, see the example.py script. Be aware that this script needs
pytorch, sklearn and numpy to run.
Citation Request
If you use onlinehd code, please cite the following paper:
- Alejandro Hernández-Cano, Namiko Matsumoto, Eric Ping, Mohsen Imani "OnlineHD: Robust, Efficient, and Single-Pass Online Learning Using Hyperdimensional System", IEEE/ACM Design Automation and Test in Europe Conference (DATE), 2021.
Related Skills
node-connect
345.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
106.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
345.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
345.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
