Skip to main content

Hyperdimensionality computing machine learning library

Project description

Hyperdimensionality computing machine learning library.

Forked from https://gitlab.com/alehd/hd-lib

Installation and use

Fork this repository and put it in you projects folder or use pip or pipenv:

pip install --user hyperdim

If you are using keras or sklearn it will be easy to use hyperdim. To use a model of dimensionality, say 10000:

from hyperdim.hdmodel import HDModel
from hyperdim.utils import to_categorical

import numpy as np

# Dummy datasets
samples = 100
features = 15
classes = 5

x = np.random.random(size = (samples, features))
y = [ int(np.random.random()*classes) for _ in x ]
y = to_categorical(y)

print(x.shape) # (samples, features)
print(y.shape) # (samples, classes)

# Build model
dimensions = 10000
model = HDModel(features, classes, d = dimensions)

# Fit using 30% of the data for validation, using one_shot_fit only
history = model.fit(x, y, validation_split = 0.3, epochs = 1)

print(history.history["acc"])
print(history.history["val_acc"])

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

hyperdim-0.0.6.tar.gz (6.2 kB view hashes)

Uploaded Source

Built Distribution

hyperdim-0.0.6-py3-none-any.whl (7.7 kB view hashes)

Uploaded Python 3

Supported by

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