Skip to content

Instantly share code, notes, and snippets.

@Seanny123
Created October 22, 2015 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Seanny123/0cbbdda57407b5b170e6 to your computer and use it in GitHub Desktop.
Save Seanny123/0cbbdda57407b5b170e6 to your computer and use it in GitHub Desktop.
Associative Memories
import nengo
from nengo import spa
D = 32
vo = spa.Vocabulary(D)
vo.parse("A + B + C")
vo2 = spa.Vocabulary(D/2)
vo2.parse("D + E + F")
model = spa.SPA(vocabs=[vo, vo2])
with model:
model.in_A = spa.State(D, vo)
model.in_B = spa.State(D, vo)
model.bind = spa.Bind(D, invert_b=True)
# WHY ISN'T THIS WORKING?
model.ass = spa.AssociativeMemory(vo, vo2)
#model.out = spa.State(D) # WTF?
model.out = spa.State(D/2, vo2)
model.cortical = spa.Actions(
'bind_A = in_A',
'bind_B = in_B',
'ass = bind',
'out = ass'
)
model.c_act = spa.Cortical(model.cortical)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment