Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save and Load model #2

Open
Badal-Shrestha opened this issue Oct 19, 2020 · 1 comment
Open

Save and Load model #2

Badal-Shrestha opened this issue Oct 19, 2020 · 1 comment

Comments

@Badal-Shrestha
Copy link

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?
image

@Blimpyway
Copy link

Blimpyway commented Sep 17, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants