mathLab / PINA

Physics-Informed Neural networks for Advanced modeling
https://mathlab.github.io/PINA/
MIT License
395 stars 66 forks source link

Conditions #341

Open ndem0 opened 2 months ago

ndem0 commented 2 months ago

I agree to divide conditions in multiple classes but I do not think that the residual method should be inside conditions. I see conditions more like an object that encapsulates data, if we constrain also to what the model should do we can't cover all test cases. I think that the loss to minimize should be defined only inside the solver (physics-informed, data-driven whatever), in this way is user responsibility to know how to use the data

Maybe we can think more of something like PhysicsConditions, DataConditions, GraphConditions (like the division in the dataloading)... These conditions are needed to call loss_data, loss_phys, and loss_graph (which are defined inside the solver). This helps us to do two things:

  1. We know which functions need to be defined in the solver by looking at the conditions the problem has (we can raise errors before training)
  2. We don't need to cover all classes of possible ways residuals are defined, we only need to pass the data that are needed to compute it.

_Originally posted by @dario-coscia in https://github.com/mathLab/PINA/pull/312#discussion_r1730291720_