TorchLean API

NN.Verification.PINN.Core

PINN Core #

PINN helper library: reference graphs, seeding, 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:

Require a JSON object field in an Except parser.

Instances For

    Require a JSON array field in an Except parser.

    Instances For

      Require a float-array field.

      Instances For

        Require an interval object { "lo": ..., "hi": ... }.

        Instances For

          Require an array of interval pairs with an expected length.

          Instances For

            Require one finite-difference u_bounds entry.

            Instances For

              Configuration parsed from a PINN certificate JSON.

              • pde : String

                PDE identifier carried by the certificate.

              • h : Float

                Grid spacing used by the exported finite-difference residual.

              • eps : Float

                Input perturbation radius for interval checking.

              • nPts :

                Number of sample points encoded in pts.

              • Sample points as a length-nPts 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
                def NN.Verification.PINN.approxEq (x y : Float) (tol : Float := 1e-5) :

                Approximate equality for Float used by certificate consistency checks.

                Instances For

                  Reference tanh-MLP graph for u : R -> R used by the compact PINN certificate workflow.

                  Instances For

                    Same reference architecture as buildGraph, but with a 2D input u : R^2 -> R.

                    Instances For

                      Deterministic weights matching the exporter convention (1D input).

                      Instances For

                        Deterministic weights for the 2D variant buildGraph2D.

                        Instances For

                          Seed a 1D input box $[x-\varepsilon,x+\varepsilon]$ at node id 0.

                          Instances For

                            Seed a 2D input box $[(x,y)-(\varepsilon,\varepsilon),(x,y)+(\varepsilon,\varepsilon)]$ at node id 0.

                            Instances For

                              Compute (d2u/dx2, d2u/dy2) intervals at node id=5 when available. Returns a pair of Options for X and Y directions respectively.

                              Instances For

                                Laplacian enclosure: $\Delta u=u_{xx}+u_{yy}$. For one-dimensional inputs, this returns $u_{xx}$.

                                Instances For

                                  Parse the JSON certificate consumed by the PINN verification CLI.

                                  Instances For

                                    Finite-difference residual bounds for 1D second derivative.

                                    Instances For

                                      Generic param seeding (1D).

                                      Instances For

                                        2D generic param seeding (first layer 16x2).

                                        Instances For

                                          Generic input seeding for 1D.

                                          Instances For

                                            Generic input seeding for 2D.

                                            Instances For