Class: DNN::Optimizers::RMSPropGraves

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

Instance Attribute Summary collapse

Attributes inherited from Optimizer

#learning_rate

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Optimizer

#update

Constructor Details

#initialize(learning_rate = 0.0001, alpha: 0.95, eps: 0.0001) ⇒ RMSPropGraves

Returns a new instance of RMSPropGraves.

Parameters:

  • learning_rate (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.



261
262
263
264
265
266
267
# File 'lib/dnn/core/optimizers.rb', line 261

def initialize(learning_rate = 0.0001, alpha: 0.95, eps: 0.0001)
  super(learning_rate)
  @alpha = alpha
  @eps = eps
  @m = {}
  @v = {}
end

Instance Attribute Details

#alpha ⇒ Float

Return the alpha value.

Returns:

  • (Float) —

    Return the alpha value.



250
251
252
# File 'lib/dnn/core/optimizers.rb', line 250

def alpha
  @alpha
end

#eps ⇒ Float

Return the eps value.

Returns:

  • (Float) —

    Return the eps value.



252
253
254
# File 'lib/dnn/core/optimizers.rb', line 252

def eps
  @eps
end

Class Method Details

.from_hash(hash) ⇒ Object



254
255
256
# File 'lib/dnn/core/optimizers.rb', line 254

def self.from_hash(hash)
  self.new(hash[:learning_rate], alpha: hash[:alpha], eps: hash[:eps])
end

Instance Method Details

#to_hash ⇒ Object



269
270
271
# File 'lib/dnn/core/optimizers.rb', line 269

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