boundlab.diff.zono3.tanh_linearizer#
- boundlab.diff.zono3.tanh_linearizer(xs, ys, ds)[source]#
Differential tanh linearizer using hexagon-Chebyshev β.
Examples
>>> import torch >>> import boundlab.expr as expr >>> from boundlab.diff.zono3.default.tanh import tanh_linearizer >>> x = expr.ConstVal(torch.tensor([0.5])) + 0.3 * expr.LpEpsilon([1]) >>> y = expr.ConstVal(torch.tensor([0.2])) + 0.3 * expr.LpEpsilon([1]) >>> d = x - y >>> dzb = tanh_linearizer([x], [y], [d]) >>> dzb.diff_bounds.bias.shape torch.Size([1])