Is the similarity between tanh and normal distribution just coincidence?

913 Views Asked by At

So, explaining to someone why tanh is used in machine learning (i.e. it squashes an open range to -1..+1, and changes most rapidly around 0), I brought up $\frac d{dx}$ $tanh(x)$, and it looks just like the normal distribution. But overlaying $e^{-x^2}$ we could see it was different, peaking at (roughly?) $\pi/2$

So we found up the Taylor series for each of them, wondering what the difference is. We discovered that the one for tanh is a bit complex looking, but that the $x^2$ term matches, the $x^4$ term is 2/3 vs. 1/2, and then the $x^6$ term diverges more.

I hope this question is not too vague... but is there anything else to learn here? Or is it just coincidence that these two things used a lot in machine learning approximate each other rather well, and we should move on?

(The "someone" is currently preparing for university entrance interviews and exams, to study maths.)

The desmos graph we were playing with: https://www.desmos.com/calculator/celmmwuwte

1

There are 1 best solutions below

0
On

Yes... the similarity is just a coincidence, but these two functions are used because they have similar properties.