PINA icon indicating copy to clipboard operation
PINA copied to clipboard

Comparing residuals

Open dgm2 opened this issue 1 year ago • 6 comments

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!

dgm2 avatar Oct 01 '24 07:10 dgm2

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👍🏻

dario-coscia avatar Oct 02 '24 13:10 dario-coscia

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?

dgm2 avatar Oct 02 '24 16:10 dgm2

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 avatar Oct 03 '24 17:10 dario-coscia

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

dario-coscia avatar Nov 20 '24 12:11 dario-coscia

Hello, does the residual plot usually reflect the same result as the loss plot? what would it mean to have lower loss but higher error in the residual? or this could be some error on my side.

dgm2 avatar Feb 05 '25 15:02 dgm2

Hi @dgm2, I'm not getting the issue. In a PINN framework, the mean residual is the loss function. Could you provide a minimal example code to reproduce this?

ndem0 avatar Mar 20 '25 09:03 ndem0

Hi, I am closing this issue due to inactivity. If there are any further questions, I will reopen it.

GiovanniCanali avatar Sep 09 '25 08:09 GiovanniCanali