Enable and disable learning for Spatial Pooling and Temporal Pooling


Please can you advise me on following;

  1. should we disable learning for SP and TM when we feed the testing datasets to the HTM?

training dataset
Sp.compute(sdr, learn = TRUE, activeArray)
tm.compute(self.activeColumns, learn = TRUE)

Testing dataset

Sp.compute(sdr, learn = FALSE, activeArray)
tm.compute(self.activeColumns, learn = FALSE)

Training dataset, I have 160 pateints including 24 hours of normal hr,bps

and for testing I have 70 patients which 40 of them have abnormal bp, hr,spo2 and 30 of them have normal bp,hr,spo2

1 Like

Well, that really depends on what you want the model to do. Do you want it to learn and evolve with the data stream? Or do you want it to only understand one snapshot in time (the training data stream)?

If you are looking for anomalies, I would say you train on non-anomalous data, then turn learning OFF. Anything that strays too far from the training data would be anomalous, but your model would not evolve over time to recognize new temporal patterns. So it depends on what you want.


Since you’re trying to spot abnormal bp I think you’re right to learn only on normal bp, and then turn learning off before the abnormals come in. Are you planning to combine the data from all 30 ‘normal’ patients into a big ‘training’ set and use the other 40 as a big ‘testing’ set?

As you probably know the online learning setting doesn’t generally required that you divide data into train and test, but I think it makes sense in your case. It all depends what you want the model to used to seeing.

1 Like

Thanks for the information.

@rhyolight Yes I want to detect anomalies, I don’t think I can expect the model evolve over time to recognizes new temporal patterns as I have limited rows of data. My aim is to detect abnormal signs for the patients who will have stroke.

@sheiser1 yes I was thinking about online learning characteristic of the HTM, and thanks for mentioning it. but because I want to calculate TP,FN, FP,TN then I decided for learning only feed normal bp (160 files which each file has 24 hours of readings for bp) and
then for testing I mix the normal and abnormal (40 abnormal , 30 normal) to see if it can detect anomalies and calculate the accuracy of the model?!

@sheiser1 so if the HTM is an online learning approach, why the HTM has option of disabling the learning for SP and TM? Is it for development and testing purposes? if we leave learning on , then the model will learn all the patterns of and then it does not score any anomalies?!

Thanks again for your time.

Yes, but the new patterns will be anomalies when they first show themselves, unless of course they emerge slightly, over time.

1 Like

This logic makes sense to me yes. I’m actually doing a project that involves anomaly detection using models with learning turned off, so I definitely appreciate the feature.

1 Like