cazala / synaptic

architecture-free neural network library for node.js and the browser
http://caza.la/synaptic
Other
6.92k stars 666 forks source link

Wrong formula for TANH squashing function #276

Closed yovanoc closed 6 years ago

wagenaartje commented 6 years ago

No, it is correct. Integrate it yourself to see why, or have a look at these sources:

If using cosh, it should be written as follows:

return 1/Math.pow(Math.cosh(x), 2)

But

return 1 - Math.exp(Math.tanh(x), 2)

Is just the same thing.