Class: DNN::Layers::HasParamLayer
Overview
This class is a superclass of all classes with learning parameters.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#trainable ⇒ Boolean
Setting false prevents learning of parameters.
Attributes inherited from Layer
Instance Method Summary collapse
-
#get_params ⇒ Array
The parameters of the layer.
-
#initialize ⇒ HasParamLayer
constructor
A new instance of HasParamLayer.
Methods inherited from Layer
#backward, #build, #built?, #call, call, #forward, from_hash, #load_hash, #output_shape, #to_hash
Constructor Details
#initialize ⇒ HasParamLayer
Returns a new instance of HasParamLayer.
86 87 88 89 |
# File 'lib/dnn/core/layers.rb', line 86 def initialize super() @trainable = true end |
Instance Attribute Details
#trainable ⇒ Boolean
Returns Setting false prevents learning of parameters.
84 85 86 |
# File 'lib/dnn/core/layers.rb', line 84 def trainable @trainable end |
Instance Method Details
#get_params ⇒ Array
Returns The parameters of the layer.
92 93 94 |
# File 'lib/dnn/core/layers.rb', line 92 def get_params raise NotImplementedError.new("Class '#{self.class.name}' has implement method 'get_params'") end |