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
88 89 90 91 |
# File 'lib/dnn/core/layers.rb', line 88 def initialize super() @trainable = true end |
Instance Attribute Details
#trainable ⇒ Boolean
86 87 88 |
# File 'lib/dnn/core/layers.rb', line 86 def trainable @trainable end |
Instance Method Details
#get_params ⇒ Array
Returns The parameters of the layer.
94 95 96 |
# File 'lib/dnn/core/layers.rb', line 94 def get_params raise NotImplementedError, "Class '#{self.class.name}' has implement method 'get_params'" end |