# Default threshold for tanh activation on output layer

I know that default rule of thumb is 0.5 for sigmoid and tanh can be converted to sigmoid. But, I'm interested in knowing that what is the default rule of thumb for tanh threshold? As it ranges from -1,1, it is the midpoint, i.e. 0?

## 1 Answer

A good $\tanh$ activation function is

\begin{equation} v_j=1.7159 \left[ \frac{\exp(\frac{2}{3}u_j) - \exp(-\frac{2}{3}u_j)}{\exp(\frac{2}{3}u_j) + \exp(-\frac{2}{3}u_j)} \right], \end{equation}

where $u_j$ is the input to hidden node $j$ and $v_j$ is the output. $1.7159 \tanh(\frac{2}{3}x)$ was suggested by Lecun et al.

Y. LeCun, L. Bottou, G. Orr, K. Muller. Efficient BackProp. In: Orr, G. and Muller K. (Eds), Neural Networks: Tricks of the Trade. Lecture Notes in Computer Sci., 1524:9-50, 1998.

• thanks, but this still does not answers the threshold question. The function you provide just rescales Tanh. – lvdp Feb 7 '17 at 4:53
• Are you using the tanh function results as an input into another function? What are you using tanh for that requires a threshold? – JoleT Feb 16 at 18:53