Paddle icon indicating copy to clipboard operation
Paddle copied to clipboard

gradient clipping and error clipping公式

Open yinyunfeng opened this issue 9 years ago • 1 comments

能否介绍一下paddle中 gradient clipping 和 error clipping对梯度的修改逻辑?求公式

yinyunfeng avatar Sep 08 '17 01:09 yinyunfeng

https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/math/BaseMatrix.cu#L505 对梯度截断时,调用的是这个函数。如果某个梯度值在[-threshold, threshold]范围内,保持不变;大于threshold时,置为threshold;小于-threshold时,则置为-threshold。

kuke avatar Sep 09 '17 08:09 kuke