boundlab.diff#
Differential verification: bounding f₁(x) − f₂(x) for two networks.
Verifying two structurally identical networks separately and subtracting the results is hopeless — the two error envelopes are treated as independent, so the difference inherits the sum of both. Propagating them together, with an explicit third component tracking the difference over shared error symbols, lets everything the networks have in common cancel.
The pieces:
exprDiffExpr2(a branch pair) andDiffExpr3(a pair plus its difference).opsOperators that mark differential structure inside a model —
diff_pair(),DiffLinear, and mock pruning ops.onnxdiff_net(), which merges two ONNX models into one paired graph.zono3/polysp3The interpreters, over dense zonotopes and sparse polynomials respectively.
Examples
>>> from boundlab.diff import zono3, polysp3
>>> callable(zono3.interpret) and callable(polysp3.interpret)
True
Functions
Pair the initializers of two structurally identical ONNX models. |
|
Mark |
|
Mock score-based pruning: network 1 keeps |
|
Mock softmax pruning: network 1 is |
|
Mock top-k pruning: network 2 keeps the |
Classes
A pair of expressions |
|
A triple |
|
Two parallel linear layers paired through |
Modules
Paired and tripled expressions for differential verification. |
|
Merge two ONNX models into one paired graph for differential interpretation. |
|
Custom operators that mark differential structure inside a model. |
|
Triple-sparse-polynomial abstract interpretation for differential verification. |
|
Triple-zonotope abstract interpretation for differential verification. |