TorchLean API

NN.Verification.Builtin.MlpTrainVerifyWorkflow

Train a Classifier, Then Verify Robustness #

This is the complete high-level workflow: build and train a classifier, then verify that its class cannot change inside an L-infinity input ball. Graph lowering and Alpha-Beta-CROWN execution remain inside the normal trained.verify operation.

Training:

Verification:

Run: lake exe verify -- torchlean-mlp-workflow lake exe verify -- torchlean-mlp-workflow --arithmetic ieee

@[reducible, inline]

Input dimension for the workflow model.

Instances For
    @[reducible, inline]

    Hidden width for the workflow classifier.

    Instances For
      @[reducible, inline]

      Number of output classes.

      Instances For
        @[reducible, inline]

        Input shape for the workflow model.

        Instances For
          @[reducible, inline]

          Output shape for the workflow model.

          Instances For

            Linearly separable two-dimensional training inputs.

            Instances For

              One-hot labels: positive first coordinate is class zero, negative is class one.

              Instances For

                Deterministically instantiate the workflow model from initialization seed zero.

                Instances For

                  Run training and verification under a chosen scalar backend α.

                  The trained result owns the trained parameters. The robustness call therefore checks the model that was actually trained.

                  Instances For

                    Runtime-selected typed runner used by the CLI entrypoint.

                    Instances For

                      CLI entry point for the native TorchLean MLP workflow.

                      This is wired into lake exe verify -- torchlean-mlp-workflow.

                      Instances For