![Deep Learning with PyTorch](https://wfqqreader-1252317822.image.myqcloud.com/cover/214/36700214/b_36700214.jpg)
上QQ阅读APP看书,第一时间看更新
Tanh
The tanh non-linearity function squashes a real-valued number in the range of -1 and 1. The tanh also faces the same issue of saturating gradients when tanh outputs extreme values close to -1 and 1. However, it is preferred to sigmoid, as the output of tanh is zero centered:
![](https://epubservercos.yuewen.com/DD5357/19470397608907106/epubprivate/OEBPS/Images/eec87fd4-fe4f-408b-b831-4157206a684f.png?sign=1739403131-c9xI98grzv1KV7FGLiFZRH8IeqdKJJuj-0-f0afd88d5246d62a2ed1f4a08ffbaa73)
Image source: http://datareview.info/article/eto-nuzhno-znat-klyuchevyie-rekomendatsii-po-glubokomu-obucheniyu-chast-2/