sequince.utils.optimize

sequince.utils.optimize#

Functions#

bisect_monotone_decreasing(criterion, lower, upper, ...)

Refine a bracket around a decreasing criterion's target crossing.

Module Contents#

sequince.utils.optimize.bisect_monotone_decreasing(criterion, lower, upper, target, *, tolerance, max_iterations)[source]#

Refine a bracket around a decreasing criterion’s target crossing.

The returned lower bound is the largest tested value whose criterion is at least target; the upper bound is the smallest tested value below it. Callers own endpoint validation and the policy for selecting a final value from the returned bracket.

The loop uses acai.while_loop(), preserving structured control flow under JAX compilation while retaining eager behavior on other backends.

Parameters:
  • criterion (Callable[[sequince.typing.Array], sequince.typing.Array])

  • lower (sequince.typing.Array)

  • upper (sequince.typing.Array)

  • target (sequince.typing.Array)

  • tolerance (sequince.typing.Array)

  • max_iterations (int)

Return type:

tuple[sequince.typing.Array, sequince.typing.Array]