newton.utils.leaky_min#

newton.utils.leaky_min(a, b)[source]#

Compute a numerically stable, differentiable approximation of min(a, b).

This is equivalent to smooth_min(a, b, 1e-5).

Parameters:
  • a (float) – The first value.

  • b (float) – The second value.

Returns:

A smooth, “leaky” minimum of a and b.

Return type:

float