Distillation / Equivalence certificates (MLP2) #
This module adds a distillation-style certificate:
prove that a Student network matches a Teacher network up to
εon an input box, i.e.|T(x) - S(x)| ≤ εcomponentwise for all inputsxin the domain.
The implementation is deliberately simple and reuses TorchLean's existing, proved
IBP soundness theorem for 2-layer MLPs (NN.MLTheory.CROWN.Theorems.bound_ibp_sound).
Small vector helpers #
Interval arithmetic on output boxes #
Interval subtraction: boxSub T S encloses all pointwise differences x - y with x ∈ T, y ∈ S.
Instances For
Predicate asserting all coordinates of B lie in [-eps, eps].
Instances For
Instances For
Correctness of checkBoxWithinAbs.
If x ∈ T and y ∈ S, then x - y ∈ boxSub T S.
Project a Box.contains hypothesis to scalar inequalities at a single coordinate.
Distillation certificate for 2-layer MLPs #
Computable checker: returns true if IBP proves the student matches the teacher
up to eps (componentwise) on the given input box.
Instances For
Soundness: if checkEquivalence_mlp2 returns true, then for all inputs x in xB,
the outputs are eps-close componentwise: |T(x)_i - S(x)_i| ≤ eps.