TyXe-BDL / TyXe

MIT License
144 stars 33 forks source link

Unable to save and load models #14

Closed canbooo closed 2 years ago

canbooo commented 2 years ago

Is there a way to save and load models, especially the ones using MCMC? I was hoping to use something along the lines of pyro.get_param_store but it does not work with MCMC apparently.

hpplyt commented 2 years ago

We don't implement any saving/loading functionality beyond what Pytorch and Pyro provide unfortunately.

I won't have time to experiment with this myself in the near future, but if you're happy to modify your TyXe version locally, you could try, instead of storing the MCMC object as an attribute on the MCMC_BNN instance as we currently do, to just keep the samples dictionary from the MCMC run and save/load that attribute. That would require slightly modifying the predict function accordingly.

canbooo commented 2 years ago

Worked as intended. Thank you very much! Hit me up, if you decide to offer saving/loading functionality and require a PR.