Photon-AI-Research / NeuralSolvers

Neural network based solvers for partial differential equations and inverse problems :milky_way:. Implementation of physics-informed neural networks in pytorch.
MIT License
141 stars 46 forks source link

Adding an opportunity too add model specific losses #17

Closed StillerPatrick closed 3 years ago

StillerPatrick commented 3 years ago

Models like the GatedPINN uses a model specific loss in order to balance the utilization of the experts. An option would be to give the model an attribute called loss.

In the PINN loss we can call the loss function with :

if hasattr(self.model, 'loss'):
    pinn_loss = pinn_loss + model.loss