Verification #
Convenience names for compiling TorchLean models into IBP/CROWN checks.
Compile a sequential TorchLean model into verifier IR with one distinguished input.
Usual "train a model, then run IBP/CROWN on its forward pass" path.
Instances For
Compile a custom TorchLean forward program into verifier IR with one distinguished input.
Use this when the target is not a plain TorchLean.nn.Sequential, for example a hand-written loss program or
an attention fragment built directly from TorchLean.Ops.
Instances For
Seed the verifier input with an explicit input box.
Call this after compileForward, then hand the returned store to IBP/CROWN passes.
Instances For
Flatten a center tensor and radius tensor into the FlatBox expected by IBP/CROWN.
Use this for a shaped TorchLean input with a shaped perturbation radius.
Instances For
Build a uniform $\ell^\infty$ box around a shaped TorchLean input tensor.
This fills the input shape with the scalar radius eps, then flattens it into a verifier box.
Instances For
Seed the compiled verifier input with a uniform $\ell^\infty$ box around a shaped TorchLean input tensor.
Instances For
Shape of the distinguished verifier input node.
Instances For
Flattened dimension of the distinguished verifier input node.
Instances For
Affine context for the distinguished verifier input.
Instances For
Run IBP on a compiled verifier graph.
Instances For
Read the verifier output box, throwing an IO.userError if it is missing.
Instances For
Run the forward affine pass after validating the compiled verifier input.
Instances For
Read the verifier output affine form from a forward affine result array.
Instances For
Run CROWN after validating the compiled verifier input.
Instances For
Read the verifier output CROWN bounds from a CROWN result array.
Instances For
Run forward CROWN and evaluate the verifier output bounds on the compiled input box.
Instances For
Run forward CROWN and return the evaluated verifier output box, throwing on failure.
Instances For
Run backward CROWN for a scalar objective and evaluate it on the compiled input box.
Instances For
IO version of backwardObjectiveBox?.
Instances For
Compute the conservative two-class margin lower bound $\mathrm{lo}[\mathrm{class0}]-\mathrm{hi}[\mathrm{class1}]$.
If this is positive, class class0 is certified against class1 over the input box.
Instances For
Decide whether the two-class margin lower bound is strictly positive.