Class: DNN::Activations::Sigmoid
Instance Method Summary collapse
Instance Method Details
#backward(dout) ⇒ Object
10 11 12 |
# File 'lib/dnn/core/activations.rb', line 10 def backward(dout) dout * (1 - @out) * @out end |
#forward(x) ⇒ Object
6 7 8 |
# File 'lib/dnn/core/activations.rb', line 6 def forward(x) @out = 1 / (1 + NMath.exp(-x)) end |