TorchLean API

NN.Verification.PINN.PyTorch.Load

PINN PyTorch Checkpoint Loading #

PINN weight import (JSON → typed tensors).

This is the “loading” half of the PINN PyTorch bridge:

The generic JSON helpers (loadWeights?, parseTensor, inferMatrixDims, …) live in NN/Runtime/PyTorch/Import/Core.lean.

One fully-connected layer of a PINN (weights + bias) as trained in PyTorch.

Instances For

    A parsed PINN state dict together with the inferred TorchLean sequential PINN architecture.

    Instances For

      Activation metadata #

      Python training scripts often record which nonlinearity they used. We treat that as optional metadata under meta.activation. If it is missing (or unknown), we default to tanh.

      Internal: parse optional activation metadata from JSON (meta.activation).

      Instances For

        Load a PINN state dict with arbitrary hidden widths.

        Expected keys:

        • layers.<i>.weight and layers.<i>.bias for each layer index i
        • optional meta.activation

        Unlike fixed-shape demos, we infer (outDim, inDim) for each layer from the JSON matrix shape.

        Instances For