kumar-shridhar / PyTorch-BayesianCNN

Bayesian Convolutional Neural Network with Variational Inference based on Bayes by Backprop in PyTorch.
MIT License
1.42k stars 323 forks source link

[Question]Regression #55

Closed aunsid closed 4 years ago

aunsid commented 4 years ago

I haven't been to replicate regression. I am trying to replicate the results from this post But it seems you have used criterion = metrics.ELBO() and not CrossEntropyLoss()

Am I missing something? Could you post a simple regression example?

Originally posted by @kumar-shridhar in https://github.com/kumar-shridhar/PyTorch-BayesianCNN/issues/9#issuecomment-489296114

aunsid commented 4 years ago

I was able to fix this. If someone is interested in having a regression example. Here is the source code.

https://drive.google.com/file/d/1Tu1LkYrN_8vvKvA-Fx143VfXUZ0Aw7Cg/view?usp=sharing

kikyo97 commented 3 years ago

I was able to fix this. If someone is interested in having a regression example. Here is the source code.

https://drive.google.com/file/d/1Tu1LkYrN_8vvKvA-Fx143VfXUZ0Aw7Cg/view?usp=sharing

Access to this link requires permission, and I have just applied for it. I hope you can give me a chance to learn

kikyo97 commented 3 years ago

I was able to fix this. If someone is interested in having a regression example. Here is the source code.

https://drive.google.com/file/d/1Tu1LkYrN_8vvKvA-Fx143VfXUZ0Aw7Cg/view?usp=sharing

I was able to fix this. If someone is interested in having a regression example. Here is the source code.

https://drive.google.com/file/d/1Tu1LkYrN_8vvKvA-Fx143VfXUZ0Aw7Cg/view?usp=sharing

Thank you for your example. In the https://www.ritchievink.com/blog/2019/09/16/variational-inference-from-scratch/, I find the loss includes reconstruction_error = -dist.Normal(y_pred, .1).log_prob(y).sum(). This is different from the ELBO_regression. Can you explain this to me? Thanks a lot!