oa::FnMatrix::tanhBwd
tanhBwd: backward pass for Tanh activation. Computes: dInput = dOutput * (1 - tanh(x)^2), using saved tanh(x) output.
Function Documentation
tanhBwd: backward pass for Tanh activation. Computes: dInput = dOutput * (1 - tanh(x)^2), using saved tanh(x) output.
Parameters
inForwardOutputconst Matrix &—
inGradOutputconst Matrix &—
Returns
MatrixThe declared return value.