Example: Export a BoundLab VNN Pipeline to ONNX#
This example shows how to export a verification pipeline to ONNX.
The pipeline follows:
Build a neural network.
Apply
zono.interpretto operate on symbolic expressions.Concretize with
ublb().Export the resulting
(ub, lb)computation graph to ONNX.
Script#
Use:
python examples/export_vnn_to_onnx.py --output ./boundlab_vnn.onnx
Optional parameters:
python examples/export_vnn_to_onnx.py \
--input-dim 64 \
--width 128 \
--depth 3 \
--output-dim 32 \
--eps-scale 0.1 \
--output ./artifacts/vnn_bounds.onnx
What Gets Exported#
The exported ONNX model:
input: concrete tensor
xoutputs:
ub,lb
Internally, it encodes the BoundLab VNN process:
symbolic abstract input
ConstVal(x) + epszonotope interpretation via
zono.interpret(...)on FX/exported IRconcretization via
ublb()
Source#
See the full script at:
examples/export_vnn_to_onnx.py