Class: DNN::Activations::Sigmoid
- Inherits:
-
Layers::Layer
- Object
- Layers::Layer
- DNN::Activations::Sigmoid
- Defined in:
- lib/dnn/core/activations.rb
Instance Method Summary collapse
Methods inherited from Layers::Layer
#build, #built?, #initialize, #prev_layer, #shape, #to_hash
Constructor Details
This class inherits a constructor from DNN::Layers::Layer
Instance Method Details
#backward(dout) ⇒ Object
9 10 11 |
# File 'lib/dnn/core/activations.rb', line 9 def backward(dout) dout * (1 - @out) * @out end |
#forward(x) ⇒ Object
5 6 7 |
# File 'lib/dnn/core/activations.rb', line 5 def forward(x) @out = 1 / (1 + Xumo::NMath.exp(-x)) end |