lib/dnn/core/utils.rb in ruby-dnn-0.9.4 vs lib/dnn/core/utils.rb in ruby-dnn-0.10.0
- old
+ new
@@ -10,13 +10,14 @@
end
y2
end
# Convert hash to an object.
- def self.load_hash(hash)
+ def self.from_hash(hash)
+ return nil if hash == nil
dnn_class = DNN.const_get(hash[:class])
- if dnn_class.respond_to?(:load_hash)
- return dnn_class.load_hash(hash)
+ if dnn_class.respond_to?(:from_hash)
+ return dnn_class.from_hash(hash)
end
dnn_class.new
end
# Return the result of the sigmoid function.