Class: DNN::Optimizers::RMSProp
- Defined in:
- lib/dnn/core/optimizers.rb
Instance Attribute Summary collapse
-
#alpha ⇒ Object
Returns the value of attribute alpha.
-
#eps ⇒ Object
Returns the value of attribute eps.
-
#lr ⇒ Object
Returns the value of attribute lr.
Attributes inherited from Optimizer
Instance Method Summary collapse
-
#initialize(lr: 0.001, alpha: 0.9, eps: 1e-7, clip_norm: nil) ⇒ RMSProp
constructor
A new instance of RMSProp.
- #load_hash(hash) ⇒ Object
- #to_hash ⇒ Object
Methods inherited from Optimizer
from_hash, #update, #update_layers
Constructor Details
#initialize(lr: 0.001, alpha: 0.9, eps: 1e-7, clip_norm: nil) ⇒ RMSProp
Returns a new instance of RMSProp.
153 154 155 156 157 158 159 160 |
# File 'lib/dnn/core/optimizers.rb', line 153 def initialize(lr: 0.001, alpha: 0.9, eps: 1e-7, clip_norm: nil) super(clip_norm: clip_norm) @lr = lr @alpha = alpha @eps = eps @g = {} @status = { g: @g } end |
Instance Attribute Details
#alpha ⇒ Object
Returns the value of attribute alpha.
147 148 149 |
# File 'lib/dnn/core/optimizers.rb', line 147 def alpha @alpha end |
#eps ⇒ Object
Returns the value of attribute eps.
148 149 150 |
# File 'lib/dnn/core/optimizers.rb', line 148 def eps @eps end |
#lr ⇒ Object
Returns the value of attribute lr.
146 147 148 |
# File 'lib/dnn/core/optimizers.rb', line 146 def lr @lr end |
Instance Method Details
#load_hash(hash) ⇒ Object
174 175 176 |
# File 'lib/dnn/core/optimizers.rb', line 174 def load_hash(hash) initialize(lr: hash[:lr], alpha: hash[:alpha], eps: hash[:eps], clip_norm: hash[:clip_norm]) end |
#to_hash ⇒ Object
162 163 164 |
# File 'lib/dnn/core/optimizers.rb', line 162 def to_hash super(lr: @lr, alpha: @alpha, eps: @eps) end |