I would like to code this neural net activation function, using the C language:
$$f(x) = 1.7159 \tanh( (2/3) x )$$
and 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. derivative of $\tanh(x)$ is $1/\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/\cosh^2((2/3)x)$$
Is this correct?
