Class: DNN::Callbacks::NaNStopping
- Defined in:
- lib/dnn/core/callbacks.rb
Overview
A callback to stop training the model if loss is NaN by after train on batch.
Instance Attribute Summary
Attributes inherited from Callback
Instance Method Summary collapse
Instance Method Details
#after_train_on_batch ⇒ Object
99 100 101 |
# File 'lib/dnn/core/callbacks.rb', line 99 def after_train_on_batch throw :stop, "loss is NaN." if model.last_log[:train_loss].nan? end |