boundlab.diff.zono3.reciprocal_linearizer#

boundlab.diff.zono3.reciprocal_linearizer(xs, ys, ds)[source]#

Differential 1/x linearizer using hexagon-Chebyshev β.

Assumes both x and y are strictly positive.

Examples

>>> import torch
>>> import boundlab.expr as expr
>>> from boundlab.diff.zono3.default.reciprocal import reciprocal_linearizer
>>> x = expr.ConstVal(torch.tensor([2.0])) + 0.1 * expr.LpEpsilon([1])
>>> y = expr.ConstVal(torch.tensor([3.0])) + 0.1 * expr.LpEpsilon([1])
>>> d = x - y
>>> dzb = reciprocal_linearizer([x], [y], [d])
>>> dzb.diff_bounds.bias.shape
torch.Size([1])