mathLab / PINA

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

Comparing residuals #350

Open dgm2 opened 1 month ago

dgm2 commented 1 month ago

The 2D residuals, for example for the wave problem (tutorial3), can have positive and negative color-bar values. In order to compare multiple approaches with the same color-bar, should I take the absolute values, and then see where is lowest? thanks!

dario-coscia commented 1 month ago

Hi @dgm2! There is not a unique metric to assess the quality of the solution. Usually, one computes the $L_2$ norm (see here) of the residual for different methodologies and see which one archives the lowest. However, it depends on your specific problem and what you want to check👍🏻

dgm2 commented 1 month ago

My question is how to compare multiple residuals via the plot as you have in tutorial2 and tutorial3. The issue with current code is that the residuals can be positive or negative on the colorbar. I am wondering, a negative value is always better than a positive one? or we should consider their absolute values?

dario-coscia commented 1 month ago

The "best" value is when the residual is zero, so a very negative value is as bad as a very positive value. To assess which model is better you can look at the axis, the best model is the one with the colorbar values closer to zero.

dario-coscia commented 1 week ago

Hi @dgm2! Can I close the issue, were you able to compare different pinns? We are preparing a tutorial exactly for that, stay tuned!