Class: DNN::Layers::Mish
- Includes:
- LayerNode
- Defined in:
- lib/dnn/core/layers/activations.rb
Instance Attribute Summary
Attributes inherited from Layer
Instance Method Summary collapse
Methods included from LayerNode
Methods inherited from Layer
#<<, #build, #built?, #call, call, #clean, #compute_output_shape, #forward, from_hash, #initialize, #load_hash, #to_hash
Constructor Details
This class inherits a constructor from DNN::Layers::Layer
Instance Method Details
#backward_node(dy) ⇒ Object
161 162 163 164 165 |
# File 'lib/dnn/core/layers/activations.rb', line 161 def backward_node(dy) omega = 4 * (@x + 1) + 4 * Xumo::NMath.exp(2 * @x) + Xumo::NMath.exp(3 * @x) + Xumo::NMath.exp(@x) * (4 * @x + 6) delta = 2 * Xumo::NMath.exp(@x) + Xumo::NMath.exp(2 * @x) + 2 dy * (Xumo::NMath.exp(@x) * omega) / delta**2 end |