I am trying to setup a HTM.java network in order to find out whether I can use it in some practical applications.
So, for now, my goal is to use a scalar/ category encoder and then feed the network with some repetitive data to make sure that the network is able to learn the sequence.
Here is my setup:
Publisher:
this.publisher = Publisher.builder()
.addHeader(“alarm”)
.addHeader(“float”)
.addHeader(“B”)
.build();
Network setup:
Network.create(“Camera Analytics Network”, p)
.add(Network.createRegion(“Region 1”)
.add(Network.createLayer(“Layer 2/3”, p)
.alterParameter(KEY.AUTO_CLASSIFY, Boolean.TRUE)
.add(Anomaly.create())
.add(new TemporalMemory())
.add(new SpatialPooler())
.add(Sensor.create(ObservableSensor::create,
SensorParams.create(
Keys::obs, new Object[] { “Camera Analytics Publisher”, this.publisher })))));
Scalar encoding parameters:
fieldEncodings = setupMap(
null,
500,
21,
1, 1000, 0, 0, Boolean.FALSE, Boolean.FALSE, Boolean.FALSE,
“alarm”, “float”, “ScalarEncoder”);
The rest of HTM parameters are default the parameters.
So far so good!
Now, when I am feeding in with the values: 100.0, 200.0, … 1000.0 in a loop,
after a while I get the following result:
Record Number: 810, input Value: 100.0, anomaly Score: 0.0, predicted value: 1000.0
Record Number: 811, input Value: 200.0, anomaly Score: 0.0, predicted value: 1000.0
Record Number: 812, input Value: 300.0, anomaly Score: 0.0, predicted value: 1000.0
Record Number: 813, input Value: 400.0, anomaly Score: 0.0, predicted value: 1000.0
Record Number: 814, input Value: 500.0, anomaly Score: 0.0, predicted value: 1000.0
Record Number: 815, input Value: 600.0, anomaly Score: 0.0, predicted value: 1000.0
Record Number: 816, input Value: 700.0, anomaly Score: 0.0, predicted value: 1000.0
Record Number: 817, input Value: 800.0, anomaly Score: 0.0, predicted value: 1000.0
Record Number: 818, input Value: 900.0, anomaly Score: 0.0, predicted value: 800.0
Record Number: 819, input Value: 1000.0, anomaly Score: 0.0, predicted value: 1000.0
The anomaly score looks good but the prediced values stay more or less constant, around 1000.0
I found a similar behaviour when I used the SDRCategoryEncoder. After learning, the last value in the list is the predicted value.
Any idea what is wrong with this setup?