未验证 提交 e8990e64 编写于 作者: Y Yibing Liu 提交者: GitHub

Fix trust ratio in lamb (#17614)

test=develop
上级 2a7b3211
......@@ -174,10 +174,11 @@ struct LambParamUpateFunctor {
inline HOSTDEVICE void operator()(size_t i) const {
T lr = *lr_;
T p_norm = *param_norm_;
T tr_div_norm = *trust_ratio_div_norm_;
T p = *param_norm_;
T t = *trust_ratio_div_norm_;
lr *= p_norm / tr_div_norm;
T r = (p > 0 && t > 0) ? p / t : 1.0;
lr *= r;
param_out_[i] = param_[i] - lr * trust_ratio_div_[i];
}
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册