oa::FnMatrix::tanhBwd

tanhBwd: backward pass for Tanh activation. Computes: dInput = dOutput * (1 - tanh(x)^2), using saved tanh(x) output.

Function Documentation

Matrix oa::FnMatrix::tanhBwd( const Matrix & inForwardOutput, const Matrix & inGradOutput )
tanhBwd: backward pass for Tanh activation. Computes: dInput = dOutput * (1 - tanh(x)^2), using saved tanh(x) output.

Parameters

inForwardOutput
const Matrix &

inGradOutput
const Matrix &

Returns

Matrix

The declared return value.