https://github.com/smallhelm/sdr
javascirpt functions to work with Sparse Distributed Representations
https://github.com/smallhelm/sdr
Last synced: 7 months ago
JSON representation
javascirpt functions to work with Sparse Distributed Representations
- Host: GitHub
- URL: https://github.com/smallhelm/sdr
- Owner: smallhelm
- License: mit
- Created: 2016-06-30T02:19:40.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-06-30T03:48:40.000Z (almost 10 years ago)
- Last Synced: 2025-01-11T07:38:52.937Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sdr
[](https://travis-ci.org/smallhelm/sdr)
Functions for working with [Sparse Distributed Representation](https://github.com/numenta/nupic/wiki/Sparse-Distributed-Representations)
> one of biggest problems in AI
> --no, the only problem in AI--
> is the problem of representation
So said a [retiring AI researcher](https://youtu.be/A8sHMcCk0lU?t=9m51s)
If you don't know what SDRs are, you should go learn about them. [numenta.org](http://numenta.org) Or watch [these videos](https://www.youtube.com/playlist?list=PL3yXMgtrZmDqhsFQzwUC9V8MeeVOQ7eZ9) for an easy to follow introduction.
## Usage
Your SDR arrays are always assumed to be in order from least to greatest. The functions use this assumption to optimize performance.
```js
var sdr = require('sdr');
sdr.union(
[0, 10, 15, 30],
[0, 5, 10, 20]
);
//-> [0, 5, 10, 15, 20, 30]
sdr.intersect(
[1, 2],
[2, 3]
);
//-> [2]
sdr.sparsity([0, 10, 20], 100);
//-> 0.03
sdr.capacity(2048, 40);
//-> 2.3717785116453587e+84
```
## License
MIT