elm-pure
elm-pure copied to clipboard
Save and Load model
I used pickle to save and load the model. The pickle file has been saved but I am unable to load the pickle model due to the ELM attribute error not defined. I even import the ELM module while loading pickle model it still throws the same error.
Is there any best way to load and save this model?
The class is so simple that I think you can save all init parameters including the self._w, self_beta and self._bias which are easy to serialize numpy arrays.
Furthermore, you can spare a lot of data if instead of the full _w and _bias you use and save a random seed to generate them and save in full only the _beta matrix (last layer) as it is the only one computed by fit().
In the mnist example the _beta is almost 1/80 the size of the entire model. beta size is 10x512 floats vs (784+1)x512 size for W and bias arrays.
PS sorry bias is all zero, you may as well skip it.