A vocabulary can be set up to relate random vectors to specific symbols. This example shows a vocabulary of A, B, and C. A is fed into a function then into a net called A then into a net called B. this can also be controlled in the interface by clicking on A and getting the semantic pointer graph that shows the activation of each vector in the vocabulary. Then click on the graph and choose set value to change or combine the vector values. Note that the vector representation is different from the dimension value representation (also note that the default is only to show the values for the first 5 dimensions, this can be changed by clicking on the graph). The dimensions need to be the same for all of the nets involved.
import nef
import hrr
vocab=hrr.Vocabulary(32)
vocab.parse('A,B,C')
net=nef.Network('Test Network')
net.add_to(world)
input1=net.make_input('input1',values=vocab.parse('A').v)
A=net.make('A',neurons=100,dimensions=32)
B=net.make('B',neurons=100,dimensions=32)
net.connect(input1,A)
net.connect(A,B)
import nef
import hrr
vocab=hrr.Vocabulary(32)
vocab.parse('A,B,C')
net=nef.Network('Test Network')
net.add_to(world)
input1=net.make_input('input1',values=vocab.parse('A').v)
A=net.make('A',neurons=100,dimensions=32)
B=net.make('B',neurons=100,dimensions=32)
net.connect(input1,A)
net.connect(A,B)
No comments:
Post a Comment