TorchLean API

NN.Verification.PINN.Core

PINN Core #

PINN helper library: reference graphs, seeding, derivatives, and certificate parsing.

This module is shared by the PINN verification workflows. It provides:

Run the curated entrypoints instead of importing this file directly:

References:

Parse an object-valued JSON field.

Instances For

    Parse an array-valued JSON field.

    Instances For

      Parse a finite-float-array JSON field.

      Instances For

        A closed interval with finite floating-point endpoints.

        • lower : Float

          Lower endpoint.

        • upper : Float

          Upper endpoint.

        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.

              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.

                  • Sample points as a length-pointCount 1D tensor.

                    PyTorch analogue: this is the torch.Tensor you would keep in memory after loading a JSON/CSV list of sample coordinates.

                  Instances For

                    A parsed and validated PINN certificate artifact.

                    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.

                                    Instances For