Margin Certificate Checker #
Reusable checker for per-example logit-margin certificates (robust_margin_cert_v0_1).
The checker reads exported output bounds and recomputes the strict top-label margin:
logits_hi[j] < logits_lo[label] for every j ≠ label.
Certificate format tag expected at the top level of margin certificate JSON files.
Instances For
Instances For
@[implicit_reducible]
def
NN.Verification.Robustness.MarginCert.Counters.push
(counts : Counters)
(nominalOk cert : Bool)
:
Add one (nominalOk, certifiedOk) outcome to the report counters.
Instances For
def
NN.Verification.Robustness.MarginCert.checkWithTiming
(path : String)
(timing : Bool)
(timingEvery : ℕ)
:
Check a robust_margin_cert_v0_1 JSON certificate file.
If timing = true, prints per-example timings every timingEvery examples.
Instances For
Check a margin certificate file with timing disabled.
Instances For
Parsed CLI flags for a margin-certificate run.
- path : String
Certificate JSON path.
- timing : Bool
Print per-example checker timings.
- timingEvery : ℕ
Print every
timingEveryexamples when timing is enabled;0disables periodic lines.