boundlab.zono.exp_linearizer#

boundlab.zono.exp_linearizer(expr)[source]#

Minimal-area exp relaxation (DeepT, Section 4.5).

For each element with input bounds [l, u]:

  • Degenerate (u ≈ l): output is exp(l), no error.

  • General: tangent line at optimal point t_opt as lower bound, secant between (l, exp(l)) and (u, exp(u)) as upper bound.

Examples

>>> import torch
>>> import boundlab.expr as expr
>>> from boundlab.zono.exp import exp_linearizer
>>> x = expr.ConstVal(torch.tensor([0.0])) + 0.1 * expr.LpEpsilon([1])
>>> b = exp_linearizer(x)
>>> b.bias.shape
torch.Size([1])