Class: DNN::Layers::Softplus
- 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, #forward, from_hash, #initialize, #load_hash, #output_shape, #to_hash
Constructor Details
This class inherits a constructor from DNN::Layers::Layer
Instance Method Details
#backward_node(dy) ⇒ Object
49 50 51 |
# File 'lib/dnn/core/layers/activations.rb', line 49 def backward_node(dy) dy * (1 / (1 + Xumo::NMath.exp(-@x))) end |
#forward_node(x) ⇒ Object
44 45 46 47 |
# File 'lib/dnn/core/layers/activations.rb', line 44 def forward_node(x) @x = x Xumo::NMath.log(1 + Xumo::NMath.exp(x)) end |