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

Custom model_loss for Bayesian PINN #15

Open
izzatum opened this issue Jul 13, 2021 · 4 comments
Open

Custom model_loss for Bayesian PINN #15

izzatum opened this issue Jul 13, 2021 · 4 comments

Comments

@izzatum
Copy link

izzatum commented Jul 13, 2021

Hi! Is there any way to use Hamiltorch for Bayesian PINN, especially in calling fmodel in each iteration to evaluate the PDE loss?

@AdamCobb
Copy link
Owner

Hi!

You might be able to use the callable custom loss by setting model_loss = foo(output, y).

This is written here:

elif callable(model_loss):

All the best,

Adam

@zzhang222
Copy link

Hi,

I don't think it's possible to use the current custom loss to incorporate PDE loss, since the PDE loss includes the term
grad(output, x)
However, you can write a Bayesian PINN by writing an nn.Module that outputs grad(output, x) as well as the boundary condition in its forward function and set model_loss = "regression". I tried that and it works. Hope that helps.

@zzhang222
Copy link

Hi! Is there any way to use Hamiltorch for Bayesian PINN, especially in calling fmodel in each iteration to evaluate the PDE loss?

I just created a repository, check it out if you are interested:
https://github.com/zzhang222/Bayesian-PINN-Pytorch

@izzatum
Copy link
Author

izzatum commented Mar 10, 2022 via email

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

3 participants