Class: DNN::Optimizers::AdaBound
- Defined in:
- lib/dnn/core/optimizers.rb
Instance Attribute Summary collapse
-
#final_lr ⇒ Object
Returns the value of attribute final_lr.
-
#gamma ⇒ Object
Returns the value of attribute gamma.
Attributes inherited from Adam
#alpha, #amsgrad, #beta1, #beta2, #eps
Attributes inherited from Optimizer
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(alpha: 0.001, beta1: 0.9, beta2: 0.999, final_lr: 0.1, gamma: 0.001, eps: 1e-7, amsgrad: false, clip_norm: nil) ⇒ AdaBound
constructor
A new instance of AdaBound.
- #to_hash ⇒ Object
Methods inherited from Optimizer
Constructor Details
#initialize(alpha: 0.001, beta1: 0.9, beta2: 0.999, final_lr: 0.1, gamma: 0.001, eps: 1e-7, amsgrad: false, clip_norm: nil) ⇒ AdaBound
Returns a new instance of AdaBound.
324 325 326 327 328 |
# File 'lib/dnn/core/optimizers.rb', line 324 def initialize(alpha: 0.001, beta1: 0.9, beta2: 0.999, final_lr: 0.1, gamma: 0.001, eps: 1e-7, amsgrad: false, clip_norm: nil) super(alpha: alpha, beta1: beta1, beta2: beta2, eps: eps, amsgrad: amsgrad, clip_norm: clip_norm) @final_lr = final_lr @gamma = gamma end |
Instance Attribute Details
#final_lr ⇒ Object
Returns the value of attribute final_lr.
314 315 316 |
# File 'lib/dnn/core/optimizers.rb', line 314 def final_lr @final_lr end |
#gamma ⇒ Object
Returns the value of attribute gamma.
315 316 317 |
# File 'lib/dnn/core/optimizers.rb', line 315 def gamma @gamma end |
Class Method Details
.from_hash(hash) ⇒ Object
317 318 319 320 |
# File 'lib/dnn/core/optimizers.rb', line 317 def self.from_hash(hash) self.new(alpha: hash[:alpha], beta1: hash[:beta1], beta2: hash[:beta2], final_lr: hash[:final_lr], gamma: hash[:gamma], eps: hash[:eps], amsgrad: hash[:amsgrad], clip_norm: hash[:clip_norm]) end |
Instance Method Details
#to_hash ⇒ Object
330 331 332 333 334 335 |
# File 'lib/dnn/core/optimizers.rb', line 330 def to_hash { class: self.class.name, alpha: @alpha, beta1: @beta1, beta2: @beta2, final_lr: @final_lr, gamma: @gamma, eps: @eps, amsgrad: amsgrad, clip_norm: @clip_norm } end |