A library for training and running HDC models on embedded devices. Currently hardware optimized for ARM Cortex-M4.
scripts/export_matrix.py allows you to export a binary hyperspace to a C header file to be included in your main.c. The syntax is as follows:
python3 export_matrix.py {TYPE} {DIM} {ROWS} {NAME}
Where TYPE should be either 'r' for random, 'l' for level, or 'c' for circular. DIM and ROWS should be integers corresponding to the dimension and number of hypervectors in the hyperspace respectively. NAME is the name of the hyperspace and also the name of the Matrix variable generated by the script. The script will write the header file to STDOUT, so you must redirect the output to a header file. Here's an example usage:
python3 export_matrix.py r 10000 784 my_random > my_random.h
Currently only builds a library 'libmatrix.a' that you have to link in your project. In future, will have ARCH argument for different platforms.
Many operations on integers other than 8-bit still unimplemented.