Class: DNN::Callbacks::CheckPoint

Inherits:
Callback
  • Object
show all
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

#model

Instance Method Summary collapse

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_epochObject



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