Skip to main content

No project description provided

Project description

MM-HDC: Maximum-Margin Hyperdimensional Computing

This repository provides an implementation of the multi-class maximum-margin hyperdimensional computing (MM-HDC) classifier that adopts the optimization problem formulation of multi-class Weston-Watkins SVM to HDC.

The algorithm is implemented in the MultiMMHDC class, which can be imported as:

from mmhdc import MultiMMHDC
from mmhdc.utils import HDTransform

You can run the MNIST example from the GitHub repo as follows:

git clone https://github.com/nzeulin/mmhdc.git && cd mmhdc
python -m pip install --upgrade pip && python -m pip install mmhdc
python -m pip install -r example/requirements.txt
python example/example.py --config example/mnist_config.py

C++ backend is highly recommended to use, as it can significantly accelerate the model training. In this case, use python -m pip install mmhdc[cpp].

NOTE: If you don't have gcc installed in your system (required for compiling C++ module), you can install it as a Conda package into your venv: conda install -c conda-forge gxx_linux-64.

Current features

  • C++ backend (libtorch) to enable fast MM-HDC training.
  • Support of floating-point prototypes and hypervectors.

Tips for best results

Empirically, setting C=torch.inf, selecting relatively low lr (e.g., the default lr=1e-5), and fine-tuning margin_width between [0..1] leads to the highest classification accuracy and smooth convergence.

Citation

If you use this repository in your research, please cite our paper:

@article{zeulin2026large,
  title={Large-Margin Hyperdimensional Computing: A Learning-Theoretical Perspective},
  author={Zeulin, Nikita and Galinina, Olga and Balakrishnan, Ravikumar and Himayat, Nageen and Andreev, Sergey},
  journal={arXiv preprint arXiv:2603.03830},
  year={2026}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mmhdc-0.1.1.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mmhdc-0.1.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file mmhdc-0.1.1.tar.gz.

File metadata

  • Download URL: mmhdc-0.1.1.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mmhdc-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d4e2f401e7ca03b8337fe6f0460e460c81f25cac3cfd35b7983039152a8ce9cb
MD5 7ae503d72d2420e2e95381024ecacb2b
BLAKE2b-256 86a28400908e12c371a5f80ca74b99b43ee07e7d6c703e7b9a283d7e6e9b03a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for mmhdc-0.1.1.tar.gz:

Publisher: publish-pypi.yml on nzeulin/mmhdc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mmhdc-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mmhdc-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mmhdc-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8b503d4324dcb4e7f6f732f0da06ecbe322d9c61183f7b5573a1c684f7a5c73c
MD5 cce6a0d85b7d648b6cf65111af88fa05
BLAKE2b-256 33362fca9356fbd48d9ccc32be4beae8c7464906f4c0d21555b04d7749d2adb9

See more details on using hashes here.

Provenance

The following attestation bundles were made for mmhdc-0.1.1-py3-none-any.whl:

Publisher: publish-pypi.yml on nzeulin/mmhdc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page