Can I save separated trained models using Docker?

Hey all,

So I’m using the docker file to run NuPIC since that’s what I’ve been able to get running, though everything in it seems to be in read-only format. My objective is to train and save a number of NuPIC models (~20), one model for each data set (as each represents that actions of a separate human controller). The plan is to learn these 20 models, then send in one stream of control inputs to each model to determine which model most closely matches this stream. Matt layed out an approach for ranking the models using Anomaly Likelihood which makes total sense, I’m just trying to figure out if I’ll be able to change the run.py file to save a separate model every time a new data set comes in. I’m using Ubuntu on amazon’s AWS service too in case that makes a difference. Thanks!

1 Like

This is a little bit out-of-scope for this forum since it’s really a Docker I/O question, but it could be helpful if it resulted in changes to our Dockerfile that allowed model serialization.

So does anyone with Docker experience know how we might do this?

We run Docker in production. The key to preserving model checkpoints is to make sure that the directory used to store those checkpoints is a volume. Of course, the following example is specific to Taurus/HTM for Stocks, which uses htmengine, so I’m not sure how much of it applies directly to what you’re doing. Suffice to say, when you call model.save(), specify a path in the container that is mapped as a volume to some persistent storage location outside of the container (by virtual of the -v argument to docker run).

In Taurus/HTM for Stocks, we have this entry in the Dockerfile:

VOLUME ["/opt/numenta/taurus_engine/logs", \
        "/root/taurus_model_checkpoints"]

Then, in a roundabout way, configure the location at runtime to point to /root/taurus_model_checkpoints, and upon deployment specify -v /taurus-permanent-storage/checkpoints:/root/taurus_model_checkpoints in the docker run command.

1 Like