boundlab.ibp.Softmax2ExpReciprocal#
- class boundlab.ibp.Softmax2ExpReciprocal[source]#
Bases:
OpHandlerRewrite softmax as \(1 / \sum_j e^{\nu_j - \nu_i}\) over the last axis.
The
expandreciprocalsteps go through the enclosing domain’s handlers (overridable viainterp_exp/interp_reciprocal). The denominator is also evaluated in plain interval arithmetic and joined with the symbolic version throughIntersects, so the reciprocal sees the tighter of the two enclosures per element — the interval one wins exactly where symbolic cancellation has degenerated.Methods
Whether this handler applies to these operands (default: always).
Transform the operands; sub-operations go through
interp.<op>so the enclosing domain's handlers apply to them too.A copy of this handler that takes precedence over
otherwhen both are ready for the same call.- handle(interp, x, **params)[source]#
Transform the operands; sub-operations go through
interp.<op>so the enclosing domain’s handlers apply to them too.
- __init__(op='softmax', interp_exp=None, interp_reciprocal=None)#
- override_handler(other)#
A copy of this handler that takes precedence over
otherwhen both are ready for the same call.