class DNN::Regularizers::Regularizer
Attributes
param[RW]
Public Class Methods
from_hash(hash)
click to toggle source
# File lib/dnn/core/regularizers.rb, line 7 def self.from_hash(hash) return nil unless hash regularizer_class = DNN.const_get(hash[:class]) regularizer = regularizer_class.allocate raise DNNError, "#{regularizer.class} is not an instance of #{self} class." unless regularizer.is_a?(self) regularizer.load_hash(hash) regularizer end
Public Instance Methods
forward(x)
click to toggle source
# File lib/dnn/core/regularizers.rb, line 16 def forward(x) raise NotImplementedError, "Class '#{self.class.name}' has implement method 'forward'" end
load_hash(hash)
click to toggle source
# File lib/dnn/core/regularizers.rb, line 26 def load_hash(hash) raise NotImplementedError, "Class '#{self.class.name}' has implement method 'load_hash'" end
to_hash(merge_hash)
click to toggle source
# File lib/dnn/core/regularizers.rb, line 20 def to_hash(merge_hash) hash = { class: self.class.name } hash.merge!(merge_hash) hash end