标签:梯度 裁剪 for optimizer glob global 梯度下降 计算 color
gvs = optimizer.compute_gradients(loss) # 计算出梯度和变量值 capped_gvs = [(tf.clip_by_value(grad, -5e+10, 5e+10), var) for grad, var in gvs] # 梯度裁剪 train_op = optimizer.apply_gradients(capped_gvs, global_step=global_step) # 梯度下降
标签:梯度 裁剪 for optimizer glob global 梯度下降 计算 color
原文地址:https://www.cnblogs.com/callyblog/p/10819276.html