Hello Nupic:
Today I ran the hello_tp.py and it performed well. To test the tp's capbility
of relating the context, I changed the sequence "ABCDE" to "ABCADE"(I didn't
change the parameter of the TP), then ran it . You can see the output of this
procedure below. the most important part is the red part, you are easily aware
of that the prediction of A is not D, but the code: 0000000000 1111111111
0000000000 1111111111 0000000000 .
so I want to know that how can I make the prediction of this procedure to be
more accurate, in other words, how to make the tp to relate the
context("ABCA"). should I change some parameter of the TP() function or some
others?
Thank you in advance!!
/usr/bin/python2.7 /home/megart/????/mynupic/test/hello_tp.py
This program shows how to access the Temporal Pooler directly by demonstrating
how to create a TP instance, train it with vectors, get predictions, and inspect
the state.
The code here runs a very simple version of sequence learning, with one
cell per column. The TP is trained with the simple sequence A->B->C->D->E
HOMEWORK: once you have understood exactly what is going on here, try changing
cellsPerColumn to 4. What is the difference between once cell per column and 4
cells per column?
PLEASE READ THROUGH THE CODE COMMENTS - THEY EXPLAIN THE OUTPUT IN DETAIL
-------- A -----------
Raw input vector
1111111111 0000000000 0000000000 0000000000 0000000000
All the active and predicted cells:
Inference Active state
1111111111 0000000000 0000000000 0000000000 0000000000
0000000000 0000000000 0000000000 0000000000 0000000000
Inference Predicted state
0000000000 0000000000 0000000000 0000000000 0000000000
0000000000 1111111111 0000000000 0000000000 0000000000
The following columns are predicted by the temporal pooler. This
should correspond to columns in the *next* item in the sequence.
[10 11 12 13 14 15 16 17 18 19]
-------- B -----------
Raw input vector
0000000000 1111111111 0000000000 0000000000 0000000000
All the active and predicted cells:
Inference Active state
0000000000 0000000000 0000000000 0000000000 0000000000
0000000000 1111111111 0000000000 0000000000 0000000000
Inference Predicted state
0000000000 0000000000 0000000000 0000000000 0000000000
0000000000 0000000000 1111111111 0000000000 0000000000
The following columns are predicted by the temporal pooler. This
should correspond to columns in the *next* item in the sequence.
[20 21 22 23 24 25 26 27 28 29]
-------- C -----------
Raw input vector
0000000000 0000000000 1111111111 0000000000 0000000000
All the active and predicted cells:
Inference Active state
0000000000 0000000000 0000000000 0000000000 0000000000
0000000000 0000000000 1111111111 0000000000 0000000000
Inference Predicted state
0000000000 0000000000 0000000000 0000000000 0000000000
1111111111 0000000000 0000000000 0000000000 0000000000
The following columns are predicted by the temporal pooler. This
should correspond to columns in the *next* item in the sequence.
[0 1 2 3 4 5 6 7 8 9]
-------- A -----------
Raw input vector
1111111111 0000000000 0000000000 0000000000 0000000000
All the active and predicted cells:
Inference Active state
0000000000 0000000000 0000000000 0000000000 0000000000
1111111111 0000000000 0000000000 0000000000 0000000000
Inference Predicted state
0000000000 0000000000 0000000000 0000000000 0000000000
0000000000 1111111111 0000000000 1111111111 0000000000
The following columns are predicted by the temporal pooler. This
should correspond to columns in the *next* item in the sequence.
[10 11 12 13 14 15 16 17 18 19 30 31 32 33 34 35 36 37 38 39]
-------- D -----------
Raw input vector
0000000000 0000000000 0000000000 1111111111 0000000000
All the active and predicted cells:
Inference Active state
0000000000 0000000000 0000000000 0000000000 0000000000
0000000000 0000000000 0000000000 1111111111 0000000000
Inference Predicted state
0000000000 0000000000 0000000000 0000000000 0000000000
0000000000 0000000000 0000000000 0000000000 1111111111
The following columns are predicted by the temporal pooler. This
should correspond to columns in the *next* item in the sequence.
[40 41 42 43 44 45 46 47 48 49]
-------- E -----------
Raw input vector
0000000000 0000000000 0000000000 0000000000 1111111111
All the active and predicted cells:
Inference Active state
0000000000 0000000000 0000000000 0000000000 0000000000
0000000000 0000000000 0000000000 0000000000 1111111111
Inference Predicted state
0000000000 0000000000 0000000000 0000000000 0000000000
0000000000 0000000000 0000000000 0000000000 0000000000
The following columns are predicted by the temporal pooler. This
should correspond to columns in the *next* item in the sequence.
[]
Process finished with exit code 0
Weiru Zeng