TorchLean API

NN.Examples.Verification.LiRPA.CnnVerify

CnnVerify #

LiRPA/IBP certificate checker: CNN conv2d -> linear head.

This is a small workflow that:

References:

Export (Python): python3.12 scripts/verification/lirpa/export_cnn_cert.py

Run (Lean): lake exe verify -- lirpa-cnn [NN/Examples/Verification/LiRPA/cnn_cert.json]

Small fixed graph: input(flattened) -> linear(conv2d-as-affine) -> linear(head).

We keep it flat so the certificate checker works over FlatBox inputs.

Instances For

    Seed deterministic parameters and the input box.

    Key trick: we compute an affine form for conv2d (A, c) on the input box and insert it as a linearWB entry, so the graph contains only .linear nodes.

    Instances For

      Check an IBP certificate JSON against this CNN graph.

      This is wired into lake exe verify -- lirpa-cnn [path].

      Instances For