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

Instance Method Summary collapse

Methods inherited from Optimizer

from_hash, #update, #update_layers

Constructor Details

#initialize(rho: 0.95, eps: 1e-6, clip_norm: nil) ⇒ AdaDelta



181
182
183
184
185
186
187
# File 'lib/dnn/core/optimizers.rb', line 181

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

Instance Attribute Details

#epsObject

Returns the value of attribute eps.



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

def eps
  @eps
end

#rhoObject

Returns the value of attribute rho.



176
177
178
# File 'lib/dnn/core/optimizers.rb', line 176

def rho
  @rho
end

Instance Method Details

#load_hash(hash) ⇒ Object



204
205
206
# File 'lib/dnn/core/optimizers.rb', line 204

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

#to_hashObject



189
190
191
# File 'lib/dnn/core/optimizers.rb', line 189

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