Skip to content

Helmholtz 2D – hyperparameter search

Example
Source DeepXDE example
Problem Forward
Dimension 2D (x, y)
Regime Steady
Geometry Rectangle
Outputs u
Settings Default (no separate Tuned preset)
Heat maps of the PINN solution, the reference solution and the error of the 2D Helmholtz problem
The search's starting configuration (run 0: learning rate 10⁻³, 4 × 50, sin; relative L₂ 3.3 × 10⁻¹), before the 50-run Bayesian search — PINN, reference and error. The selected run (lowest final training loss) is under *Results*.

Governing equations

Mathematical form (from the benchmark records):

\[-\nabla^2 u - k_0^2 u = k_0^2\sin(k_0 x)\sin(k_0 y), \qquad k_0 = 4\pi,\ (x, y) \in [0, 1]^2\]

As typed in PINNStudio's Equations page (each expression is a residual, set to zero):

-du_xx - du_yy - k0**2*u - k0**2*sin(k0*x)*sin(k0*y)

Constants: n = 2, k0 = 2*pi*n

Domain

  • Rectangle: \(x \in [0, 1]\), \(y \in [0, 1]\)

Boundary conditions

No boundary-condition rows: the boundary values are imposed exactly through the network's output transform (see Methods below), or the problem has no boundary terms.

Settings

Settings: Default — a 50-run Bayesian search (Parameter Sweep), the configuration selected by the lowest final training loss; each run starts from DeepXDE's network and training below

  • Network: FNN, hidden layers 4 × 50, inputs (x, y), 1 output; activation sin, initializer Glorot uniform
  • Points: 400 domain, 80 boundary, 3,600 test
  • Loss weights: 1 (equations, then boundary-condition rows)
  • Methods: output transform x*(1 - x)*y*(1 - y)*u (reference)
Phase Optimizer Iterations Learning rate Decay
1 Adam 10,000 0.001 none

No Tuned preset: the example is its own search, and its configuration is chosen by the lowest final training loss, not by the error against the reference.

Results

The configuration selected in PINNStudio's benchmark study, run on one RTX 4090. Forward: relative L₂ error of each output at the last reference time. Inverse: each parameter's relative error and, per seed, the largest of them (worst parameter error).

Forward problem

Settings: Default — the example's Bayesian search, 50 runs; selected: the run with the lowest final training loss (run 49); the example has no separate Tuned preset for this mode. Values: one run, seed 2026, selected by its final training loss (not the reference error); the search's 50 runs are in its record.

Output Relative L₂
u 1.3 × 10⁻³
Forward result: PINN, reference and error
Forward, Default settings: PINN, reference and error.

Full benchmark record: every setting tried, the per-seed values and all figures are in the benchmark records on GitHub.

Loading it in PINNStudio

  • Forward: toolbar Examples: › Forward › under the ── 2D ── heading, Helmholtz 2D – hyperparameter search › Default, then Solve.

Loading an example fills in every setting; anything you change before Solve is listed in the Training Log. Your save folder, GPU, random-seed and plot-style settings are kept.

Reference solution

  • Exact solution, Error Analysis › reference from formula: u = sin(k0*x)*sin(k0*y)

Notes

  • Bayesian search over learning rate (1e-4 to 5e-2, log scale), hidden layers (1 to 10), neurons per layer (5 to 500) and activation (sin, sigmoid, tanh): the baseline (1e-3, 4 x 50, sin) and 9 random runs (10 before the model, the baseline counted), then runs chosen by a Gaussian-process model, 50 in all (Parameter Sweep, mode Bayesian search). Each run minimizes the final training loss (DeepXDE's script uses the lowest test loss). Click Run Sweep.

Definition and records

How the benchmark values were measured and checked: Reproducibility.

← Back to the example gallery