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
107 108 109 |
# File 'lib/dnn/core/callbacks.rb', line 107 def after_train_on_batch throw :stop, "loss is NaN." if model.last_log[:loss].nan? end |