boundlab.diff.zono3.linearizer_to_hander#
- boundlab.diff.zono3.linearizer_to_hander(linearizer)[source]#
Register a differential lineariser for a non-linear activation.
The decorated function receives
(xs, ys, ds)— three parallel lists ofExpr, one entry per input to the nonlinearity — and returns aDiffZonoBounds.For unary activations (relu, tanh, …) each list has length 1. For binary operations each list has length 2, with
xs[i]/ys[i]/ds[i]being the i-th input’s x-network, y-network, and diff components respectively.diff_bounds.input_weights[i]is the weight applied tods[i];diff_x_weights[i]/diff_y_weights[i]are the weights applied toxs[i]/ys[i].diff_x_error/diff_y_errorare applied to the same epsilon variables introduced forx_bounds/y_bounds, enabling exact diff tracking for cases where no fresh error is needed.All inputs must be
DiffExpr3orDiffExpr2; if none are, the call falls back to the standard zonotope handler.DiffExpr2inputs have their diff synthesised asx − y.