nicodjimenez / lstm

Minimal, clean example of lstm neural network training in python, for learning purposes.
1.72k stars 654 forks source link

The tanh_derivative should be : 1. + values**2 #41

Open Ningshiqi opened 5 years ago

hdsong1996 commented 4 years ago

No, he is right.[tanh(x)]'=1-[tanh(x)]^2

try1995 commented 3 years ago

[tanh(x)]' = [sin(x)/cos(x)]' = (cos(x)^2 + sin(x)^2)/cos(x)^2 = 1 + tanx(x)^2

laluarif93 commented 3 years ago

tanh x is not the same as tan x

nicodjimenez commented 3 years ago

It's been a while since I've looked at this codebase... if there's something wrong can someone submit a PR?