Class: DNN::Layers::HasParamLayer
Overview
This class is a superclass of all classes with learning parameters.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#params ⇒ Array
readonly
The parameters of the layer.
-
#trainable ⇒ Bool
Trainable Setting false prevents learning of parameters.
Attributes inherited from Layer
Instance Method Summary collapse
-
#initialize ⇒ HasParamLayer
constructor
A new instance of HasParamLayer.
Methods inherited from Layer
#backward, #build, #built?, #forward, #output_shape, #to_hash
Constructor Details
#initialize ⇒ HasParamLayer
Returns a new instance of HasParamLayer.
62 63 64 65 66 |
# File 'lib/dnn/core/layers.rb', line 62 def initialize super() @params = {} @trainable = true end |
Instance Attribute Details
#params ⇒ Array (readonly)
Returns The parameters of the layer.
60 61 62 |
# File 'lib/dnn/core/layers.rb', line 60 def params @params end |
#trainable ⇒ Bool
Returns trainable Setting false prevents learning of parameters.
58 59 60 |
# File 'lib/dnn/core/layers.rb', line 58 def trainable @trainable end |