PINN Core #
PINN helper library: reference graphs, seeding, derivatives, and certificate parsing.
This module is shared by the PINN verification workflows. It provides:
- a dimension-parameterized CROWN graph for a tanh MLP,
- deterministic parameters and typed input-box seeding,
- a few interval/finite-difference residual helpers,
- JSON parsing for the certificate schema used by the surrounding examples.
Run the curated entrypoints instead of importing this file directly:
lake exe verify -- pinn-cert [NN/Examples/Verification/PINN/pinn_cert.json]lake exe verify -- pinn-dataset-check --dataset=PATH.json [--weights=WEIGHTS.json]
References:
- PINNs (physics-informed neural nets):
https://arxiv.org/abs/1711.10561 - CROWN (linear bound propagation):
https://arxiv.org/abs/1811.00866 - IBP (interval bound propagation):
https://arxiv.org/abs/1810.12715
Parse an object-valued JSON field.
Instances For
A closed interval with finite floating-point endpoints.
Instances For
Instances For
Parse an interval object { "lo": ..., "hi": ... }.
Instances For
Parse parallel lower/upper arrays into checked intervals.
Instances For
One finite-difference sample from a PINN certificate.
- point : Float
Coordinate at the center of the finite-difference stencil.
- previous : FloatInterval
- center : FloatInterval
Solution enclosure at
point. - next : FloatInterval
Instances For
Instances For
Parse one finite-difference u_bounds entry.
Instances For
Configuration parsed from a PINN certificate JSON.
- pde : String
PDE identifier carried by the certificate.
- spacing : Float
Grid spacing used by the exported finite-difference residual.
- radius : Float
Input perturbation radius for interval checking.
- pointCount : ℕ
Number of sample points encoded in
points. - points : TorchLean.Tensor Float [self.pointCount]
Sample points as a length-
pointCount1D tensor.PyTorch analogue: this is the
torch.Tensoryou would keep in memory after loading a JSON/CSV list of sample coordinates.
Instances For
A parsed and validated PINN certificate artifact.
- config : CertificateConfig
Model and sampling configuration.
- residualBounds : Array FloatInterval
Finite-difference residual enclosures at each sample point.
- derivativeResidualBounds : Array FloatInterval
Derivative residual enclosures at each sample point.
- solutionBounds : Array SolutionBounds
Solution enclosures for each three-point finite-difference stencil.
Instances For
Tolerance for comparing a Lean-recomputed PINN bound against the decimal an external exporter
printed. It is looser than the 1e-6 the leaf-artifact checker uses because these bounds come out
of a finite-difference stencil, so the exported decimal carries more accumulated rounding than a
single subtraction does. The comparison itself is NN.Verification.Util.approxEq; there is one
implementation of it in the verification layer and this is only the constant it gets called with.
Instances For
The reference scalar-output PINN architecture at an arbitrary input dimension.
Instances For
Build the reference PINN graph at the requested input dimension.
Instances For
Deterministic reference parameters at an arbitrary input dimension.
These values mirror the bundled exporter. They are demonstration parameters, not trained weights;
production checks should load the exported state through PINN.PyTorch.
Instances For
Seed an $\ell_\infty$ input box centered at a typed input tensor.
Instances For
Enclose the first and second directional derivatives of the output along one input axis.
The two come back together on purpose. The second derivative is propagated on top of the first, so
splitting them into separate entry points would repeat the same sweep. The interval boxes arrive as
a parameter instead of being recomputed here, which is what lets a two-dimensional model pay for
the IBP pass once and then ask about x and y in turn. A none component means the derivative
propagator produced no box at the output node, which happens when the graph contains an operator it
does not cover.
Instances For
Parse the JSON certificate consumed by the PINN verification CLI.
Instances For
Finite-difference residual bounds for 1D second derivative.