-
Notifications
You must be signed in to change notification settings - Fork 34
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
How to sample from the posterior distribution using the Bayesian module? #73
Comments
The Bayesian module is somewhat deprecated, as the results didn't turn out as good as hoped and the EnsembleMODNetModel should be preferred. Nevertheless, sampling can be done using model.predict(x) (single outcome, should be repeated to form Monte-Carlo experiment) or model(x) giving a tensorflow_probability.distributions.Distribution. With model the Keras model (not the MODNet one). Currently the BayesianMODNetModel takes 1000 samples and computes the mean and std. modnet/modnet/models/bayesian.py Lines 316 to 320 in 6a5b139
Anyway, if you have some ideas to improve, or successful applications with this module, I would be happy to discuss ! |
Ah, gotcha. Thank you! That's too bad about the results. I've been looking into converting (my fork of) CrabNet into a Bayesian transformer network via e.g. BayesFormers, but it seems like it could be pretty involved, so I was pleased to see MODNet had some Bayesian facilities already in place. Have you thought about trying |
No, I haven't spent much time on the Bayesian model to be honest. Might be something to explore in the future ... |
I didn't notice anything obvious within
modnet/models/bayesian.py
The text was updated successfully, but these errors were encountered: