-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
激活函数Tanh的反向传播 #6
Comments
还有在nn/optimizers.py中我有些疑问: |
@qianchne 感谢您的反馈,已修正 |
@qianchne 确实是写错了,感谢您的反馈! |
您好,最近阅读了您的这个仓库,受益非浅,非常感谢。
但是我对您在nn/activations.py 中的Tanh的反向传播函数有点疑惑。
def tanh_backward(next_dz):
"""
tanh激活反向过程
:param next_dz:
:return:
"""
return 1 - np.square(np.tanh(next_dz))
根据反向传播的求导,我觉得Tanh的反向函数应该是:
def tanh_backward(next_dz, z):
return next_dz*(1 - np.square(np.tanh(z)))
谢谢您的指教。
The text was updated successfully, but these errors were encountered: