![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=1738863733-cE9OSBsHRAkBhKeQivvBrBTpJMrwNGzt-0-ae5ddc183e80fa2c8f08f679652f2847)
Image source: http://datareview.info/article/eto-nuzhno-znat-klyuchevyie-rekomendatsii-po-glubokomu-obucheniyu-chast-2/