Skip to content

Instantly share code, notes, and snippets.

@breznak
Created April 12, 2019 17:48
Show Gist options
  • Save breznak/906f75ca19cd0b3bd38a2a3f0eee3ad0 to your computer and use it in GitHub Desktop.
Save breznak/906f75ca19cd0b3bd38a2a3f0eee3ad0 to your computer and use it in GitHub Desktop.
from nupic.bindings.sdr import SDR
from nupic.bindings.algorithms import SpatialPooler as SP
a=SDR([100])
a.randomize(0.05)
a.sparse
b=SDR([100])
sp=SP([100],[100])
sp.compute(a.sparse, True, b.sparse)
b.sparse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment