boundlab.poly.interpret#

boundlab.poly.interpret = <boundlab.interp.Interpreter object>#

Polytope-based interpreter.

Dispatches neural-network operators to CROWN-style linearizers that produce PolyBoundGate-wrapped expressions.

Examples

>>> import torch
>>> from torch import nn
>>> import boundlab.expr as expr
>>> import boundlab.poly as poly
>>> op = poly.interpret(nn.Linear(2, 1))
>>> y = op(expr.ConstVal(torch.zeros(2)) + expr.LpEpsilon([2]))
>>> y.shape
torch.Size([1])