Class: DNN::Callbacks::CheckPoint
- Defined in:
- lib/dnn/core/callbacks.rb
Overview
A callback that save the model at the after of the epoch.
Instance Attribute Summary
Attributes inherited from Callback
Instance Method Summary collapse
- #after_epoch ⇒ Object
-
#initialize(base_file_name) ⇒ CheckPoint
constructor
A new instance of CheckPoint.
Constructor Details
#initialize(base_file_name) ⇒ CheckPoint
Returns a new instance of CheckPoint.
39 40 41 |
# File 'lib/dnn/core/callbacks.rb', line 39 def initialize(base_file_name) @base_file_name = base_file_name end |
Instance Method Details
#after_epoch ⇒ Object
43 44 45 |
# File 'lib/dnn/core/callbacks.rb', line 43 def after_epoch model.save(@base_file_name + "_epoch#{model.last_log[:epoch]}.marshal") end |