Dear All
I'm trying to use the temporal pooler (TP) directly as I want to get
into the details of how Nupic works (rather than high level OPF etc)
Having trained the TP I used this code to get some predictions:
for j in range(10):
x=2*math.pi/100*j
y=math.sin(x)
print "Time step:",j
for k in range(nIntervals):
if y>=ybot[k] and y<ytop[k]:
print "input=",x,y,k,rep[k,:]
tp.compute(rep[k,:],enableLearn=False,computeInfOutput=True)
tp.printStates(printPrevious = False, printLearnState = False)
break
Here is the result I got:
Time step: 0
input= 0.0 0.0 9 [0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0]
Inference Active state
0000000001 0000000000
0000000000 0000000000
Inference Predicted state
0000000000 0000000000
0000000001 0000000000
Time step: 1
input= 0.0628318530718 0.0627905195293 10 [0 0 0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0]
Inference Active state
0000000000 1000000000
0000000000 0000000000
Inference Predicted state
0000000000 0000000000
0000000001 0000000000
Time step: 2
input= 0.125663706144 0.125333233564 11 [0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0]
Inference Active state
0000000000 0100000000
0000000000 0100000000
Inference Predicted state
0000000000 0000000000
0000000000 1110000000
Time step: 3
input= 0.188495559215 0.187381314586 11 [0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0]
Inference Active state
0000000000 0000000000
0000000000 0100000000
Inference Predicted state
0000000000 0000000000
0000000000 1110000000
You can see that in time step 3, one cell (12th column) is shown as
being both in the active and predictive state, which I though was
impossible. (its inference active state is 1 and its inference
predicated state is 1)
Also if you look at time step 0, only 1 cell is in the predictive
state. However, the input that comes in at time step 1 activates the
colum to the right of this cell (the 11th slot is "1") so I would
expect the 11th column to have both cells active, the "unexpected
input state" but this does not happen.
Can anyone explain this?
John.