lib/dnn/core/models.rb in ruby-dnn-0.13.3 vs lib/dnn/core/models.rb in ruby-dnn-0.13.4
- old
+ new
@@ -6,12 +6,15 @@
attr_accessor :optimizer
attr_accessor :loss_func
# Load marshal model.
# @param [String] file_name File name of marshal model to load.
+ # @return [DNN::Models::Model] Return the loaded model.
def self.load(file_name)
- loader = Loaders::MarshalLoader.new(self.new)
+ model = self.new
+ loader = Loaders::MarshalLoader.new(model)
loader.load(file_name)
+ model
end
def initialize
@optimizer = nil
@loss_func = nil