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, include_model: true) ⇒ CheckPoint
constructor
A new instance of CheckPoint.
Constructor Details
#initialize(base_file_name, include_model: true) ⇒ CheckPoint
Returns a new instance of CheckPoint.
41 42 43 44 |
# File 'lib/dnn/core/callbacks.rb', line 41 def initialize(base_file_name, include_model: true) @base_file_name = base_file_name @include_model = include_model end |
Instance Method Details
#after_epoch ⇒ Object
46 47 48 49 |
# File 'lib/dnn/core/callbacks.rb', line 46 def after_epoch saver = Savers::MarshalSaver.new(@model, include_model: @include_model) saver.save(@base_file_name + "_epoch#{model.last_log[:epoch]}.marshal") end |