I would like to code this neural net activation function, using the C language:
$f(x) = 1.7159 \tanh( \frac{2}{3} x )$
and I will also need to code its derivative.
I've read that the derivative of $\tanh(x)$ is $\operatorname{sech}^2(x)$, but since C doesn't have a hyperbolic secant function I will need to use $\cosh$, i.e. the derivative of $\tanh(x)$ is $1\over \cosh^2(x)$, I think.
Since my knowledge of calculus is very rusty, my best attempt for the derivative of the above function is:
$1 \over \cosh^2(\frac{2}{3}x)$
Is this correct?