Class: DNN::Optimizers::AdaDelta

Inherits:
Optimizer 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

#dump, from_hash, load, #update

Constructor Details

#initialize(rho: 0.95, eps: 1e-6, clip_norm: nil) ⇒ 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.



200
201
202
203
204
205
206
207
# File 'lib/dnn/core/optimizers.rb', line 200

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

Instance Attribute Details

#epsObject

Returns the value of attribute eps.



196
197
198
# File 'lib/dnn/core/optimizers.rb', line 196

def eps
  @eps
end

#rhoObject

Returns the value of attribute rho.



195
196
197
# File 'lib/dnn/core/optimizers.rb', line 195

def rho
  @rho
end

Instance Method Details

#load_hash(hash) ⇒ Object



224
225
226
# File 'lib/dnn/core/optimizers.rb', line 224

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

#to_hashObject



209
210
211
# File 'lib/dnn/core/optimizers.rb', line 209

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