Class: DNN::Initializers::Const
- Inherits:
-
Initializer
- Object
- Initializer
- DNN::Initializers::Const
- Defined in:
- lib/dnn/core/initializers.rb
Instance Attribute Summary collapse
-
#const ⇒ Object
readonly
Returns the value of attribute const.
Instance Method Summary collapse
- #init_param(layer, param) ⇒ Object
-
#initialize(const) ⇒ Const
constructor
A new instance of Const.
- #load_hash(hash) ⇒ Object
- #to_hash ⇒ Object
Methods inherited from Initializer
Constructor Details
#initialize(const) ⇒ Const
Returns a new instance of Const.
48 49 50 51 |
# File 'lib/dnn/core/initializers.rb', line 48 def initialize(const) super() @const = const end |
Instance Attribute Details
#const ⇒ Object (readonly)
Returns the value of attribute const.
45 46 47 |
# File 'lib/dnn/core/initializers.rb', line 45 def const @const end |
Instance Method Details
#init_param(layer, param) ⇒ Object
53 54 55 |
# File 'lib/dnn/core/initializers.rb', line 53 def init_param(layer, param) param.data = param.data.fill(@const) end |
#load_hash(hash) ⇒ Object
61 62 63 |
# File 'lib/dnn/core/initializers.rb', line 61 def load_hash(hash) initialize(hash[:const]) end |
#to_hash ⇒ Object
57 58 59 |
# File 'lib/dnn/core/initializers.rb', line 57 def to_hash super(const: @const) end |