Specify loss function directly for NeuralPDE?

Hello,

In NeuralPDE you normally define the PDE (lhs-rhs=0) symbolically and the loss function is built internally, loosely \int dvars ||lhs(vars) - rhs(vars)||^2 .

Is there a way to specify the objective function symbolically directly? Let’s say you are crazy enough and just want to optimize \int dvars \, [cos(lhs(vars)) + sin(rhs (vars)) ] . What would be the easiest way to do that?

Cheers!

You crazy bastard. There’s no way to do that right now without hacking the code, but that would be cool. Open an issue and we can see how to support that. Right now you can simply add new loss terms with additional_loss, but not change the PINN loss.

1 Like

:laughing: :man_shrugging:

opened issue

Any update?

We are trying to finish a new parser that would allow for this. It has not merged yet though

1 Like

Thank you Chris for your reply.

Is it possible to change the loss weights then? In this way one can add a new loss term, and turn off others…

I guess the answer is here: Adaptive Loss Functions · NeuralPDE.jl

1 Like