深度學習_深度學習基礎知識_Gradient Clipping公式解釋

啥也不說直接上公式: 先求出梯度g,並設置梯度閾值threshold。我們再求出梯度的L2範數||g||,我們比較||g||和threshold的大小,如果||g||比threshold大,我們接着對梯度進行縮放。我們求出縮放因子: t h r e s h o l d ∣ ∣ g ∣ ∣ \frac{threshold}{||g||} ∣∣g∣∣threshold​,再將它與梯度相乘得到我們最後的
相關文章
相關標籤/搜索