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