optax.ApplyIfFiniteState#

class optax.ApplyIfFiniteState(
notfinite_count: Any,
last_finite: Any,
total_notfinite: Any,
inner_state: Any,
)[source]#

State of the GradientTransformation returned by apply_if_finite.

notfinite_count#

Number of consecutive gradient updates containing an Inf or a NaN. This number is reset to 0 whenever a gradient update without an Inf or a NaN is done.

Type:

Any

last_finite#

Whether or not the last gradient update contained an Inf or a NaN.

Type:

Any

total_notfinite#

Total number of gradient updates containing an Inf or a NaN since this optimizer was initialised. This number is never reset. inner_state: The state of the inner GradientTransformation.

Type:

Any