TorchLean API

NN.Verification.Robustness.MarginCert

Logit-Bound Report Checker #

Reusable consistency checker for exported per-example logit bounds (robust_margin_cert_v0_1).

The checker reads exported output bounds and recomputes the strict top-label margin:

$\mathrm{logits}_{\mathrm{hi}}[j]<\mathrm{logits}_{\mathrm{lo}}[\mathrm{label}]$ for every $j\neq\mathrm{label}$.

This module does not establish that the bounds enclose a model on an input region. That requires a separate verifier or a TorchLean propagation theorem. The checker validates only the internal arithmetic and summary fields of the supplied report.

Format tag expected at the top level of exported logit-bound reports.

Instances For

    Running counters for nominal accuracy and margin outcomes.

    • total :

      Number of examples checked.

    • nominalOk :

      Number of examples whose optional nominal prediction equals the label.

    • certifiedOk :

      Number of examples certified by the margin predicate.

    Instances For

      Add one (nominalOk, certifiedOk) outcome to the report counters.

      Instances For

        Check one report entry and return (nominalOk, positiveMargin).

        Instances For

          Check the internal consistency of a robust_margin_cert_v0_1 JSON report.

          If timing = true, prints per-example timings every timingEvery examples.

          Instances For

            Check a logit-bound report with timing disabled.

            Instances For

              Parsed CLI flags for a logit-bound report run.

              • path : String

                Report JSON path.

              • timing : Bool

                Print per-example checker timings.

              • timingEvery :

                Print every timingEvery examples when timing is enabled; 0 disables periodic lines.

              Instances For

                Parse shared margin-report CLI flags.

                Instances For

                  Run the checker with a caller-provided default report path.

                  Instances For