drckf / paysage

Unsupervised learning and generative models in python/pytorch.
Other
119 stars 25 forks source link

Saving models #55

Closed jrwalsh1 closed 7 years ago

jrwalsh1 commented 7 years ago

Adds some basic functionality to save models as HDFStore objects and represent layers and models as metadata configurations.

The models currently consist of layers and weights. The layer parameters and the weight matrix are saved as DataFrames in the h5 file, and a configuration for the model (mostly metadata for the layers) is also saved as an attribute.

This PR is ready, but there is more to do:

drckf commented 7 years ago

As we are saving in HDF5 format, each class could just have its own key model, optimizers, etc.

jrwalsh1 commented 7 years ago

For saving more than just the model data, the question for me is who is doing the saving. The fit method is currently the only object that knows about everything. We could always have a 'save' utils function, or a state object.

drckf commented 7 years ago

If the model (or other classes) save function took an open pandas.HDFStore object it could just write it's own data. Multiple objects can simply write to the same open stream.