Hello Chetan,
Thank for your timely reply.
1. You do not need to worry about setting `inferenceMode` to 1, it is 1 by
default.
If I set 'inferenceMode' of sp and tp to be 1, will claclassifier get right
output normally? In what kind of situation, should we set 'inferenceMode' to be
0?
2. I'm sorry, I don't really understand your question. Perhaps you can rephrase
it? Maybe it would help to see example values for the `results` dict you are
talking about.
I'm sorry that I make you feel confused. I just can't understand what's
Subutai's meaning in video[3].
If I have a multi input [4,6,9,12], 4 is the predicted fields. So the
actualInput is 4. And assume the output encoder is 0001 0010 0100 1000, the
tp's bottomUpOutput is 0001010000001, it means the 3rd,5th,12th cells are
active. The 3rd cell corresponds to 2 list which are one-to-one corresponding.
(Just as Subutai's example in video[3]). The detailed meaning of the 2 list is
what I can't understand. I think it has relationship with results I mentioned
in previous email.
3.I'm not sure what you mean. Swarming is a way to automatically discover which
fields help the most with the prediction of field1. You can also try different
combinations of fields by hand.
My meaning is, can we judge which field contributes the predicted field
directly by the permanence or synapse connection? Or another kind of
explanation: when the input data is encoded into SDR, we can't distinguish
which bit represents each input field? We can only judge from the output of
classifier. For example, Encode field 1, 2 together and get claclassifier
result. Then encode field 1,3 together and get claclassifier result. Then field
1,4 1,5 and so on. At last compare each result and judge witch filed(2,3,4,5)
contribute field 1.
4.It looks like you don't have the latest version of nupic. Please update your
repository and try it again.
I updated nupic to 0.3.1 half a month before, but it has another error[1] I
haven't resolved when I run [2]. I update nupic to 0.3.6 just now. But it still
has the error[1]. So I can't continue 'tp_py' test now. I run several other
test codes and it seem like they runs well except [2]. So I think nupic has
been installed correctly.
[1]Traceback (most recent call last):
File "/newdisk/nupic/examples/network/hierarchy_network_demo.py", line 368,
in <module>
runDemo()
File "/newdisk/nupic/examples/network/hierarchy_network_demo.py", line 362,
in runDemo
runNetwork(network, numRecords, writer)
File "/newdisk/nupic/examples/network/hierarchy_network_demo.py", line 305,
in runNetwork
network.run(1)
File "/newdisk/nupic/src/nupic/engine/__init__.py", line 666, in run
engine.Network.run(self, n)
File
"/home/abc/.local/lib/python2.7/site-packages/nupic.bindings-0.2.2-py2.7-linux-x86_64.egg/nupic/bindings/engine_internal.py",
line 1146, in run
return _engine_internal.Network_run(self, *args, **kwargs)
File "/newdisk/nupic/src/nupic/regions/CLAClassifierRegion.py", line 289, in
compute
categories = [category for category in inputs["categoryIn"]
KeyError: 'categoryIn'
[2]https://github.com/numenta/nupic/blob/master/examples/network/hierarchy_network_demo.py
[3] https://www.youtube.com/watch?v=QZBtaP_gcn0
Jing
------------------ ???????? ------------------
??????: "Chetan Surpur";<[email protected]>;
????????: 2015??10??21??(??????) ????1:44
??????: "fuyajing"<[email protected]>;
????: Re: A tp program question
Hi Jing,
1. I know when the parameter "learningmode" is set to 1, the connections
between each column and cell will keep updating. But how to set parameter
"inferencemode" ? If I have a network sensor-->sp-->tp-->claclassifier, it is
obvious that we should set claclassifier's "inferencemode" to be 1 because we
want to get the output result of claclassifier. My question is how to set sp's
and tp's "inferencemode" (both sp's and tp 's learningmode are 1 for learning
continually)?
You do not need to worry about setting `inferenceMode` to 1, it is 1 by default.
2. Does likelihood has the relationship with prediction? The "result"[4] is a
dict, which has two pairs of key-value. One is 1:list1, the other is
actualValues:list2. List1 and list2 are one-to-one correspondence. We get the
actual values in list2 which has the biggest likelihood in list1. And the sum
of list1 equals 1. But I didn't understand how the two lists are calculated.
The bucketIndex gets from scalarEncoder.getBucketIndcex(actualInput) is a
number, and list1's index is a bucket range. What's the corresponding
relationship between bucketIndex and list1? How to define list1's length and
bucket range?
I'm sorry, I don't really understand your question. Perhaps you can rephrase
it? Maybe it would help to see example values for the `results` dict you are
talking about.
3. In a multiEncoder network, if I want to predict field1, can I know which
fields contribute to field1? Not by swarming.
I'm not sure what you mean. Swarming is a way to automatically discover which
fields help the most with the prediction of field1. You can also try different
combinations of fields by hand.
4. Last time you suggest me to set a parameter to get connection relationship.
I set the 'temporalImp' in file[3] to 'tm_py' but get the error as follows.
It looks like you don't have the latest version of nupic. Please update your
repository and try it again.
- Chetan
------------------ ???????? ------------------
??????: "Chetan Surpur";<[email protected]>;
????????: 2015??10??17??(??????) ????2:52
??????: "fuyajing"<[email protected]>;
????: Re: A tp program question
Jing,
> Both spRegion and tpRegion have an attribute "bottomUpOut", which are
> arrays(0 and 1). How to decode the 01 array into a predicted value?
This is what the CLA classifier is used for. It takes these binary output
arrays, and decodes the input value to the encoder that is the most likely
prediction.
> The multiEncoder is not SDR though there is little 1 and much 0.(Or
> multiEncoder is sparse, not distributed? Which explanation is right?)
It is distributed, but not necessarily sparse. It produces sparse
representations only if the inputs to the MultiEncoder are all sparse. Either
way, the output of the SPRegion is sparse and distributed.
> So to top level (for example, classifier), we get a map from final active
> columns index (we call it 'finalColumns') to sourceData.
Correct, this is what the CLA classifier does in essence. You can just use it
on top of the TPRegion to do this classification.
> What's more, I can't understand the code segment in
> nupic/examples/network/hierachy-network-demo.py.(line 267-272)
The `results` dictionary is produced by the CLA Classifier. If you would like
to understand the CLA Classifier better, please see Subutai's recent talk on
how it works [1].
[1] https://www.youtube.com/watch?v=QZBtaP_gcn0
Hope this helps,
Chetan
On Oct 15, 2015, at 12:34 AM, fuyajing <[email protected]> wrote:
And another question: Both spRegion and tpRegion have an attribute
"bottomUpOut", which are arrays(0 and 1). How to decode the 01 array into a
predicted value?
For easier understanding, I want to express my understanding. If I have a wrong
explanation, please tell me. Thank you in advance. :)
For example, each attribute's value can be encoded into a 01 array, by setting
params w, n(or radius, or resolution) , max, min and so on.
A-->1111 0000 0000 0000
B-->0000 1111 0000 0000
C--> 0000 0000 1111 0000
Monday-->111000000000
Tuesday -->011100000000
Thursday-->001110000000
...
Then if there are two attribute need to be encoded, we can just concatenate
them simply, we call it multiEncoder.
AMonday-->1111 0000 0000 0000 111000000000
The multiEncoder is not SDR though there is little 1 and much 0.(Or
multiEncoder is sparse, not distributed? Which explanation is right?) It just
the input of the first spRegion. The out put of spRegion and tpRegion is SDR. (
We can get it from "bottomUpOut"). From the SDR, we can't distinguish which
columns represent for which input bits, right? So to top level (for example,
classifier), we get a map from final active columns index (we call it
'finalColumns') to sourceData. (If we want to predict A, it's a map from
finalColumns to A; if we want to predict Monday, it's a map from finalColumns
to Monday.) I think maybe it's the meaning of decode for HTM. The column
doesn't have a specific correspondence. Moreover, how to initialize the
connection relationship between the input 01 array and first spRegion's columns?
What's more, I can't understand the code segment in
nupic/examples/network/hierachy-network-demo.py.(line267-272)
results =
classifier.getSelf().customCompute(recordNum=recordNumber,patternNZ=tpOutput,classification=classDict)
mostLikelyResult = sorted(zip(results[1], results["actualValues"]))[-1]
How does each element of "results" come out? And I found the lengths of
result[1] and results["actualValues"] are variable lengths.
Looking forward to hear from you at earliest.
Jing
------------------ ???????? ------------------
??????: "??????";<[email protected]>;
????????: 2015??10??15??(??????) ????1:21
??????: "fuyajing"<[email protected]>;
????: A tp program question
HelloI'm using network API to make predictions. The tp_params has an attribute
"cellsPerColumn". My question is: How to get the synapses connection between
columns or cells? Are there any method or code?
Thank you in advance.
Jing