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