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, #output_shape, #to_hash
Constructor Details
#initialize ⇒ HasParamLayer
Returns a new instance of HasParamLayer.
72 73 74 75 |
# File 'lib/dnn/core/layers.rb', line 72 def initialize super() @trainable = true end |
Instance Attribute Details
#trainable ⇒ Boolean
Returns Setting false prevents learning of parameters.
70 71 72 |
# File 'lib/dnn/core/layers.rb', line 70 def trainable @trainable end |
Instance Method Details
#get_params ⇒ Array
Returns The parameters of the layer.
78 79 80 |
# File 'lib/dnn/core/layers.rb', line 78 def get_params raise NotImplementedError.new("Class '#{self.class.name}' has implement method 'get_params'") end |