TorchLean API

NN.Verification.PINN.CLI

PINN CLI #

PINN residual-bounding CLI.

This file implements a small interactive tool for bounding PDE residuals of a trained physics-informed neural network (PINN) over a box input region. Concretely, it:

This CLI is the interactive PINN residual-bound tool:

The stable artifact checker is: lake exe verify -- pinn-cert [NN/Examples/Verification/PINN/pinn_cert.json]

Run this CLI via the unified verification dispatcher: lake exe verify -- pinn-cli -- [flags] "<PDE>" x eps or for 2D: lake exe verify -- pinn-cli -- [flags] "<PDE>" x y eps

Examples:

References:

noncomputable def NN.Verification.PINN.CLI.realToFloat (x : ) (digits : := 6) :
Instances For

    Compute primitives using a rounded backend α = NF with single-precision nearest-even.

    Instances For
      Instances For

        Parse the backend flag used by the PINN residual CLI.

        Instances For

          Parse a decimal Float literal used by CLI flags.

          Instances For

            Parse a non-scientific decimal string into a generic numeric α using Numbers and Context. Supports optional leading '-' and a single '.'.

            Instances For

              Compute primitives u, duX, duY, d2uX, d2uY at the unique output node (id=5) for 1D/2D models. Optionally, replace the u-interval with a tighter CROWN/DeepPoly bound.

              Instances For

                Load optional PyTorch-exported PINN weights for the exploratory CLI.

                Malformed files or mismatched input dimensions fall back to the provided built-in graph and parameters. That permissive behavior is intentional here: pinn-cli is an interactive inspection tool. Stable certificate checkers should reject bad artifacts instead.

                Instances For

                  User-facing bound method selected by --method.

                  Instances For

                    Parse the --method value accepted by the PINN residual checker.

                    Instances For

                      Parsed options for the PINN residual CLI.

                      • method : Method

                        Bound propagation method used for the output interval.

                      • backend : Backend

                        Runtime backend used for interval evaluation.

                      • weights? : Option String

                        Optional PyTorch-exported PINN weights JSON.

                      • splitDepth :

                        Recursive interval split depth for one-dimensional checks.

                      Instances For

                        Parse recognized flags and return the remaining positional arguments.

                        Instances For

                          Entry point for the PINN residual-bounding CLI.

                          This is an interactive tool registered as: lake exe verify -- pinn-cli -- ...

                          For certificate checking, use: lake exe verify -- pinn-cert [NN/Examples/Verification/PINN/pinn_cert.json]

                          Run: lake exe verify -- pinn-cli -- [--method=ibp|crown-fwd|crown-bwd] [--split-depth=N] [--backend=float|neuralfloat] [--weights=PATH.json] "<PDE>" x eps or (2D): lake exe verify -- pinn-cli -- [flags] "<PDE>" x y eps

                          Instances For
                            def NN.Verification.PINN.CLI.main.split1D (x eps : Float) (d : ) (evalAt : FloatFloatIO (Float × Float)) :
                            Instances For
                              def NN.Verification.PINN.CLI.main.split2D (x y eps : Float) (d : ) (evalAt : FloatFloatFloatIO (Float × Float)) :
                              Instances For