Class: DNN::Initializers::He

Inherits:
Initializer show all
Defined in:
lib/dnn/core/initializers.rb

Instance Method Summary collapse

Methods inherited from Initializer

#to_hash

Instance Method Details

#init_param(layer, param_key) ⇒ Object



54
55
56
57
# File 'lib/dnn/core/initializers.rb', line 54

def init_param(layer, param_key)
  prev_dim = layer.prev_layer.shape.reduce(:*)
  super(layer, param_key, layer.params[param_key].rand_norm / Math.sqrt(prev_dim) * Math.sqrt(2))
end