I am using Nupic Algorithms API to implement the HTM. I want to know how I can save the learned HTM model so that the next time I start the program, HTM continues learning from that point instead of starting from scratch. Please note that I am using the Algorithms API and not the OPF or Network API to implement the HTM. Thank you.
3 posts were split to a new topic: KjException when serializing
I wonder if there is an example of using the new serialization, and also if there is an example of using HTM for online streaming anomaly detection.
It’s old but should still work: https://github.com/numenta/nupic/blob/master/examples/opf/clients/hotgym/anomaly/one_gym/README.md
thx for the quick answer. I wonder were I’m missing the right code for this.
so what I need is one of two:
- write a script which will run as a process, thus the model will be up always and will receive every defined amount of time new data, and run it into the model to decide if anomaly or not.
- script which will run on a data of a whole week ( for example ), save the model, and then I will have another script which will run every 2 min to check if the new received data is anomaly, of course using the saved model.
so the hot gym tutorial answers for one of these cases?
and if so should I look into “run.py” or “nupic_output.py”
if the tutorial is not matching these cases, should I look into serialization?
Im a lil bit confused here…
thx for the help:)
The hot gym example shows you how to do #1, sure. All you need to do is hold a model instance in memory and call
run() on it. That will update the model and get a new anomaly value. There is no example in there for saving, but if you don’t mind pickling you can use
model.save() (the old way).
FYI: The “new way” of serialization works too, but you have to get to the algorithm instances and save them differently (see above).
great! thank you very much