Module 8 of 14 · one week

Evaluation that can fail a model

RMSE is not a report card. PDEBench's own headline finding is that it "is not a good proxy for evaluating ML models, in particular in turbulent and non-smooth regimes". This module defines the metric suite, shows what each metric caught in the benchmark, and then computes the whole suite on this course's two labs, where it finds a grid-scale oscillation and a broken boundary condition that the field error hides completely.

Primary sources: PDEBench Section 3.3 and Appendix B (p.5 to 6, p.17), Section 4.2 and Figure 3 (p.8), Appendix H (p.23); MeshGraphNets Appendix A.5.2 (p.17); JMLR Table 9 (p.47), read from 21-1524.pdf. Lab: ../labs/01_burgers/metrics.py.

Why this module exists

The problem takes one sentence, using this course's own results. Lab 01's relative \(L^2\) at 1024 points is 0.035, the picture of the prediction is visually identical to the truth, and the output nevertheless carries an odd-even oscillation of amplitude 0.014 that neither the number nor the picture separates from anything else (Module 2). Lab 02 is worse: its field error at 128² is twelve times its error at 64², and the quantity a thermal engineer actually needs is not the field at all but the peak temperature and where it sits.

A metric that cannot fail a model is not a metric, it is a formality. The teaching survey found no course that covers evaluation and rollout metrics for neural PDE solvers (research_notes/teaching.md:215), which is why this module exists and why it comes before the scaling and foundation-model modules, not after them. You cannot audit a claim about scale without a measurement that can come back negative.

The metrics

PDEBench's suite splits into metrics computed on the data and metrics computed on the physics, and the split is the useful part: the first group asks whether the numbers are close, the second asks whether the answer is a solution of anything.

ScopeNameDefinition (PDEBench Appendix B)What it can fail
DataRMSEroot mean square errorbulk error, scale-dependent
DatanRMSE\(\|u_{\text{pred}}-u_{\text{true}}\|_2/\|u_{\text{true}}\|_2\)bulk error, scale-free; this is the "relative \(L^2\)" of every FNO table in the course
Datamax errorlargest single pointwise errorlocal blow-up; a stability proxy
PhysicscRMSE\(\|\sum u_{\text{pred}}-\sum u_{\text{true}}\|_2/N\), on a quantity the PDE conservesa violated conservation law
PhysicsbRMSERMSE restricted to the boundary pointsa boundary condition the model never learned
PhysicsfRMSE, banded\(\sqrt{\sum_{k=k_{\min}}^{k_{\max}}|F(u_{\text{pred}})-F(u_{\text{true}})|^2/(k_{\max}-k_{\min}+1)}\), with low \(k\in[0,4]\), mid \([5,12]\), high \([13,\infty)\); in 2D and 3D integrate out the angle and sum radiallyerror hidden inside one band: Gibbs oscillation at shocks, over-smoothed fine scales, grid-scale oscillations

The banded fRMSE is the one to understand instead of memorise, because it is the only member of the suite that can localise an error in frequency, and every defect this course has found so far lives at one end of the spectrum. Note one property of the definition that matters when reading the numbers below: it divides by the number of bins in the band, so it is a per-bin average and not a total. That makes it comparable across bands of different widths but means a single badly wrong bin gets diluted by however many quiet bins sit beside it.

Two more metrics come from the rollout literature. Error against horizon, reported as a curve, with the first 50 steps given separately when decoherence sets in around there (MeshGraphNets, research_notes/pdf-mgn-pdebench.md:129), and error bars: standard error over 100 test trajectories, plus min, median and max over seeds. Two more come from this course's own labs, because the benchmark suite has no equivalent: the error in the peak value, and the error in the peak's position, both in physical units.

Split rule. Split the data by initial-condition family and coefficient regime, never by taking random frames out of one trajectory, because consecutive frames of a trajectory are nearly the same field and a random-frame split leaks the answer into the training set. Hold out an entire physics family only after the shared input representation is fixed, or you are measuring the representation instead of the transfer (project kit, evaluation section). Inverse problems need a second layer: the error of the estimated initial condition and the error of the forward prediction made from it are different numbers, and the second is always smaller, because high-frequency errors in the initial condition are damped by the forward map (PDEBench Appendix B.1, :221).

What the metrics caught in PDEBench and JMLR

Each of the following is a result that a single nRMSE column would have concealed or reversed.

  1. Gibbs oscillation at shocks. As the Burgers diffusion coefficient falls and a discontinuity forms, FNO's high-band fRMSE rises by two orders of magnitude, which the authors attribute to the architecture's cap on representable frequency (Section 4.2, Figure 3, pdf-mgn-pdebench.md:246). The bulk error moves far less. Table 7 gives the bulk numbers for context: at ν = 0.001, RMSE is 1.3e-1 for U-Net, 9.6e-3 for FNO and 2.2e-1 for a PINN; at ν = 1.0 the three are 2.7e-2, 1.2e-3 and 1.1e-2 (:255).
  2. Normalization can hide the scale. On Darcy, nRMSE rises as the forcing falls, because the denominator shrinks with the solution while the error does not. Under that metric U-Net beats FNO at every forcing level, 6.4e-3 against 1.2e-2 at β = 1 (:247, :256). This is the one benchmark in the course where FNO loses on a headline number, and it is a property of the metric as much as of the models.
  3. A flat error spectrum as positive evidence. FNO shows roughly \(4\times10^{-4}\) error uniformly across the whole spectrum on many problems, which the authors read as the model learning in Fourier space instead of fitting low modes and giving up (:241). A metric that can produce evidence for a mechanism, not only against one, is doing more work than a scalar.
  4. Turbulence erases the architecture advantage. On 2D compressible flow at Mach 0.1, U-Net gives 4.7e-2 and FNO 4.9e-3 in the smooth case, a factor of ten. With a turbulent initial condition they are 3.3e-1 and 2.8e-1, a factor of 1.2 (:259). Any architecture comparison quoted without its regime is close to meaningless.
  5. Noise robustness, JMLR Table 9. With 10 percent input noise: Burgers goes 0.002 to 0.018, advection 0.002 to 0.094, Darcy 0.011 to 0.012, Navier-Stokes 0.024 to 0.039. Advection, the one problem that preserves discontinuities instead of smoothing them, is the failure, and Module 3 explains why. Training with noise closes the gap at a small cost on clean data (p.47, research_notes/pdf-fno-jmlr.md:662-687).
  6. Time extrapolation. Error grows monotonically past the training window, which is Module 7's wall, and only a horizon curve shows it.

Ground truth is not free

Every number above compares a model against a reference solution, and the reference is itself a numerical approximation. PDEBench Appendix H makes that concrete in an uncomfortable way. Its 2D diffusion-reaction data is generated at 512×512 and downsampled to 128×128 to serve as truth, and the authors compare that against data generated directly at 128×128. The coarse solver's own error against the fine reference is 1.8e-1, which is larger than the FNO's 8.1e-3 error against the same reference. The surrogate is more faithful to the fine solution than the coarse solver is. The authors add, correctly, that further work is needed to establish whether 512×512 is fine enough to count as truth at all (pdf-mgn-pdebench.md:286).

That is the reason both labs in this course carry a solver check that runs before any model is trained and aborts the script on failure. Lab 01 halves \(\Delta t\) and sees the solution move by \(1.9\times10^{-12}\), and doubles the grid to 2048 points and sees \(9\times10^{-12}\). Lab 02 solves an analytic sine load and matches it to \(1.25\times10^{-5}\), and confirms a 15 W block load between a 128 and a 256 grid to \(8.3\times10^{-5}\). The first version of Lab 01's solver failed its own check at \(2\times10^{-5}\), traced to single-precision wave numbers, and was fixed before any model saw its output. A surrogate cannot be more accurate than the data it is fitted to, so the check is not optional bookkeeping.

Lab: the suite on both labs' saved models

LAB ../labs/01_burgers/metrics.py loads the saved weights of Lab 01 run B at both values of \(k_{\max}\), and of Lab 02, and writes metrics.json. For Burgers it computes nRMSE, max error, cRMSE on the mean of \(u\), and banded fRMSE at 64 and 1024 points. For the thermal problem it computes nRMSE and max error in kelvin, bRMSE on the outer ring of cells, and banded radial fRMSE at 64² and 128², alongside the peak and hot-spot metrics that the training script already recorded.

Burgers, Lab 01 run B, 200 test samples

Model, gridnRMSEmax errorcRMSE on mean of \(u\)fRMSE low 0-4fRMSE mid 5-12fRMSE high 13-∞
\(k_{\max}=8\), 640.02240.8860.00424.96e-32.98e-36.02e-4
\(k_{\max}=8\), 10240.03491.3030.00394.91e-33.17e-31.00e-3
\(k_{\max}=16\), 640.02260.9110.00434.97e-32.83e-36.44e-4
\(k_{\max}=16\), 10240.02641.1530.00364.57e-33.00e-36.25e-4

Four things come out of that table, and none of them is visible in the nRMSE column alone.

The error the training grid could see does not change. Low-band and mid-band errors are the same at 64 and at 1024 points for both models, to within a few percent. Whatever goes wrong at an unseen grid does not go wrong in the modes the loss was computed on. That is a reassuring result and it is also the reason the bulk number rises so modestly: most of the signal lives in those bands.

The high band is where the two models part company. Going from 64 to 1024 points, the high-band error rises 66 percent for \(k_{\max}=8\), from 6.02e-4 to 1.00e-3, and does not rise at all for \(k_{\max}=16\), 6.44e-4 to 6.25e-4. Module 2 identified the culprit as a single Fourier coefficient of magnitude \(1.44\times10^{-2}\) at the Nyquist bin. Check that it is big enough to explain this: the high band at 1024 points averages over about 500 bins, so one bin at \(1.44\times10^{-2}\) contributes \(\sqrt{(1.44\times10^{-2})^2/500} = 6.4\times10^{-4}\) on its own. That is the largest single contribution in the band, and it is comparable to the entire band's value at the training grid. The \(k_{\max}=16\) model's Nyquist coefficient is \(5.64\times10^{-3}\), which contributes only \(2.5\times10^{-4}\), and its high band accordingly does not move.

The worst point is off by half the range. Max error is 0.886 to 1.303 while the field error is two to three percent. The true solution at \(t=1\) has root-mean-square amplitude 0.644 over the test set and its largest value anywhere in the test set is 2.70, so the worst point of the prediction is wrong by roughly half of the largest value in the data. That point sits on the steepest front, which is exactly where the truth's curvature is largest and where a truncated spectral representation has the least to work with. If the downstream use is a safety margin rather than an average, this column is the one that matters.

The model does not conserve what the PDE conserves. Periodic Burgers preserves the spatial mean of \(u\) exactly, since \(\partial_t\int u = -\int\partial_x(u^2/2) + \nu\int u_{xx} = 0\) when both integrands are derivatives of periodic functions. The FNO's mean is off by 0.0042 against a typical true mean of 0.2906, which is 1.4 percent, at both grids and for both values of \(k_{\max}\). Nothing in the loss asked for conservation and the model did not learn it for free. Detecting that is precisely cRMSE's job, and no amount of nRMSE would have raised the question.

Thermal, Lab 02, in kelvin

GridnRMSEmax error (K)bRMSE (K)true boundary mean (K)fRMSE low (K)fRMSE mid (K)fRMSE high (K)peak error mean (K)
64² (trained)0.00653.450.1650.7600.0600.0220.00790.20
128² (unseen)0.081413.760.6510.3770.2580.0300.2131.55

The high-band error at 128² is 27 times its value at 64² while the mid band moves by a factor of 1.4. That is the stripe pattern of Module 6's figure, converted into a number that can be tracked, compared and regressed against. It is also the two-dimensional counterpart of the Burgers Nyquist coefficient, so the same defect has now been caught twice by the same metric in two different dimensions.

The boundary row is the one that should stop a reader. At 128² the model's error on the boundary ring is 0.651 K against a true boundary mean of 0.377 K. The boundary condition is \(T=0\) there, so the true values are small numbers from the discretization, and the model is wrong by more than the entire quantity. A field metric cannot see this, because the boundary is a one-dimensional set inside a two-dimensional domain and contributes almost nothing to the bulk norm. A thermal engineer would see it immediately, because a die model that does not respect its own edge condition is not a die model.

The last column against the first completes the picture. At 128², the field is 8.1 percent wrong, the boundary is 173 percent wrong, and the peak is 2.6 percent wrong, 1.55 K on a mean peak of 58.6 K with a worst case of 6.21 K. Those three statements are all true about the same predictions, and they support three different decisions. Reporting one number would have hidden two of them, and which one you happened to report would have decided whether the model looked usable.

Sources

Exit test

You can now write down a metric suite that is capable of failing a model, say which member of it catches which defect, and check a banded number against a spectrum to confirm that the two agree about the mechanism.

  1. Write the six PDEBench metrics with their formulas and the three frequency bands, and say which of the six is a per-bin average and why that matters when comparing grids.
  2. Give one PDEBench result where U-Net beats FNO, and explain how much of that result is the models and how much is the metric.
  3. Reproduce the high-band check: from a Nyquist coefficient of \(1.44\times10^{-2}\) and a band of about 500 bins, predict the fRMSE contribution, and compare it with the measured rise from 6.02e-4 to 1.00e-3.
  4. Prove that periodic Burgers conserves the spatial mean of \(u\), then say what the lab's 0.0042 means and which metric found it.
  5. Explain why a coarse simulator can be less faithful than a surrogate trained on it, using Appendix H's two numbers, and name the check each of this course's two labs runs to avoid the same trap.