OptimNaNDebugInfo#
- class liesel.optim.OptimNaNDebugInfo(kind, epoch, batch, obs_batch, last_non_nan_position, nan_position, loss, optimizer_index, optimizer_identifier, optimizer_position_keys, reproduction_position, reproduction_carry)[source]#
Bases:
objectReproduction data for the first NaN captured by
OptimEngine.Use
reproduce_step()for NaNs introduced by an optimizer update andreproduce_loss()for NaNs returned by an optimizer’s pre-update loss or by the explicit batched loss evaluation when no optimizer is active.The reported optimizer is where NaN was first detected. An earlier update may have produced finite values outside the model’s valid parameter domain. Inspect
last_non_nan_position: it is free of NaNs, but is not necessarily a valid model state.Methods
optimizer(engine)Returns the optimizer associated with the captured NaN, if known.
reproduce_loss(engine)Reproduces the captured pre-update loss.
reproduce_step(engine)Re-runs the optimizer step that introduced a NaN position.
Attributes
Position most directly associated with the captured NaN event.
Stage at which the first NaN was detected.
Epoch index at which the NaN was detected.
Batch index at which the NaN was detected.
Observed batch used when the NaN was detected.
Last position free of NaNs; it need not be a valid model state.
Position containing the detected NaN, if available.
Loss value associated with the captured event, if available.
Index of the optimizer at detection, if known.
Identifier of the optimizer at detection, if known.
Position keys handled by the optimizer at detection, if known.
Parameter position used to reproduce the captured event.
Optimizer carry used to reproduce the captured event.