boundlab.polysp.softmax.SoftmaxConstrained#

class boundlab.polysp.softmax.SoftmaxConstrained[source]#

Bases: OpHandler

Run the domain’s softmax decomposition, then apply the sum-to-one constraint optimization (softmax_opt()) to the result.

Methods

__init__

condition

Whether this handler applies to these operands (default: always).

handle

Transform the operands; sub-operations go through interp.<op> so the enclosing domain's handlers apply to them too.

override_handler

A copy of this handler that takes precedence over other when both are ready for the same call.

op: str = 'softmax'#
inner: OpHandler#
condition(x, **params)[source]#

Whether this handler applies to these operands (default: always).

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', inner=<factory>)#
override_handler(other)#

A copy of this handler that takes precedence over other when both are ready for the same call.

overrides: list[type[OpHandler]] = []#