Created
October 22, 2015 18:22
-
-
Save Seanny123/0cbbdda57407b5b170e6 to your computer and use it in GitHub Desktop.
Associative Memories
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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