Build a SPA model with two spa.State
objects called input
and memory
. Use 32 dimensions. For the memory
, set feedback=1
so that it will act as a working memory.
Now add a BasalGanglia and Thalamus that implement the following two actions:
actions = spa.Actions(
'dot(input, HELLO) --> memory=input',
'0.5 --> ',
)
The first action says that if the input is something close to HELLO, then send that input into the memory. The second action says that if none of the other actions is above 0.5, then do nothing.
What happens if you feed HELLO into the input?
Now feed BYE into the input. What happens?
What happens if you feed HELLO+WORLD into the input?
Instead of just having one memory, create two different memories; one for verbs and one for objects.
Now create new actions for handling verbs and objects. For example, the following actions will store the verb SAY and the verb WRITE in the verb memory. Add actions for a few more verbs and objects.
'dot(input, SAY) --> verb=input'
'dot(input, WRITE) --> verb=input'
Having one action per word is not going to scale well. Since these actions have identical results, we should be able to combine them together. Find a way to efficiently combine them into a single action.
(If you are stuck on this, look at the spa-parse
tutorial example)
What are the advantages of combining them in this way? What are the disadvantages?
In [ ]: