Class: DNN::Optimizers::AdaDelta

Inherits:
Optimizer 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(rho: 0.95, eps: 1e-6) ⇒ AdaDelta

Returns a new instance of AdaDelta.

Parameters:

  • rho (Float) (defaults to: 0.95) —

    Moving average index of past slopes.

  • eps (Float) (defaults to: 1e-6) —

    Value to avoid division by zero.



170
171
172
173
174
175
176
# File 'lib/dnn/core/optimizers.rb', line 170

def initialize(rho: 0.95, eps: 1e-6)
  super(nil)
  @rho = rho
  @eps = eps
  @h = {}
  @s = {}
end

Instance Attribute Details

#eps ⇒ Float

Return the eps value.

Returns:

  • (Float) —

    Return the eps value.



162
163
164
# File 'lib/dnn/core/optimizers.rb', line 162

def eps
  @eps
end

#rho ⇒ Float

Return the rho value.

Returns:

  • (Float) —

    Return the rho value.



160
161
162
# File 'lib/dnn/core/optimizers.rb', line 160

def rho
  @rho
end

Class Method Details

.from_hash(hash) ⇒ Object



164
165
166
# File 'lib/dnn/core/optimizers.rb', line 164

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

Instance Method Details

#to_hash ⇒ Object



178
179
180
# File 'lib/dnn/core/optimizers.rb', line 178

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