Class: DNN::Optimizers::RMSPropGraves

Inherits:
Optimizer
  • Object
show all
Defined in:
lib/dnn/core/optimizers.rb

Instance Attribute Summary collapse

Attributes inherited from Optimizer

#clip_norm, #status

Instance Method Summary collapse

Methods inherited from Optimizer

from_hash, #update, #update_layers

Constructor Details

#initialize(lr: 0.0001, alpha: 0.95, eps: 0.0001, clip_norm: nil) ⇒ RMSPropGraves

Returns a new instance of RMSPropGraves.

Parameters:

  • lr (Float) (defaults to: 0.0001)

    Learning rate.

  • alpha (Float) (defaults to: 0.95)

    Moving average index of past slopes.

  • eps (Float) (defaults to: 0.0001)

    Value to avoid division by zero.



222
223
224
225
226
227
228
229
230
# File 'lib/dnn/core/optimizers.rb', line 222

def initialize(lr: 0.0001, alpha: 0.95, eps: 0.0001, clip_norm: nil)
  super(clip_norm: clip_norm)
  @lr = lr
  @alpha = alpha
  @eps = eps
  @m = {}
  @v = {}
  @status = { m: @m, v: @v }
end

Instance Attribute Details

#alphaObject

Returns the value of attribute alpha.



216
217
218
# File 'lib/dnn/core/optimizers.rb', line 216

def alpha
  @alpha
end

#epsObject

Returns the value of attribute eps.



217
218
219
# File 'lib/dnn/core/optimizers.rb', line 217

def eps
  @eps
end

#lrObject

Returns the value of attribute lr.



215
216
217
# File 'lib/dnn/core/optimizers.rb', line 215

def lr
  @lr
end

Instance Method Details

#load_hash(hash) ⇒ Object



246
247
248
# File 'lib/dnn/core/optimizers.rb', line 246

def load_hash(hash)
  initialize(lr: hash[:lr], alpha: hash[:alpha], eps: hash[:eps], clip_norm: hash[:clip_norm])
end

#to_hashObject



232
233
234
# File 'lib/dnn/core/optimizers.rb', line 232

def to_hash
  super(lr: @lr, alpha: @alpha, eps: @eps)
end