Skip to content

Gray–Scott

Reaction–diffusion pattern formation (self-replicating spots and labyrinths):

ut=ε12u+b1(1u)c1uv2,vt=ε22vb2v+c2uv2.

The patterns grow from a localized seed on top of an unstable homogeneous equilibrium — exactly the setting where PINNs are prone to spurious steady solutions.

Results

relative L2 error 7.0e-03recipe 4 time windows + adaptive pseudo-time4 × 100k steps, single GPU

This is the suite's most dramatic rescue. Trained naively over the whole time range, the network converges to the spurious homogeneous state and never grows the pattern — a relative L2 error of 0.90 despite a small training loss. Splitting the horizon into four time windows and enabling adaptive pseudo-time stepping recovers the full pattern-formation dynamics at 7.0e-03 over the stitched trajectory — a ~130× improvement, with each window trained from a fresh initialization (transfer_learning=False). Pseudo-time alone (no windows) already recovers to 0.03, confirming the spurious-equilibrium diagnosis; the windowed curriculum then removes the remaining long-horizon error.

Reference, PINN prediction, and absolute error of the v-field: pattern growth from a localized seed.

Gray-Scott convergence

Training losses and per-variable errors across all four windows (the sawtooth marks each window's fresh restart).

Run

bash
cd examples/gray_scott
python3 main.py --config=configs/pseudo_time.py \
    --config.time_range="(0.0, 1.0)" \
    --config.training.num_time_windows=4 \
    --config.training.transfer_learning=False
ConfigDescription
configs/baseline.pyPirateNet + causal weighting
configs/pseudo_time.pyAdaptive pseudo-time stepping (showcase, with 4 windows)
configs/fixed_pseudo_time.pyConstant pseudo-time weights

Notes

  • A key benchmark for pseudo-time stepping: the unstable homogeneous equilibrium is a perfect residual minimizer that plain training happily finds.
  • Supports a fixed residual batch (--config.training.random_sampling=False) for controlled pseudo-time experiments.

Released under the Apache 2.0 License.