有提供全局梯度裁剪的op嘛?
Created by: guozhiyao
我想要像pytorch那样对全局梯度norm进行裁剪,但是官网api提供的例子只能针对某一层设置
import paddle.fluid as fluid
w_param_attrs = fluid.ParamAttr(name=None,
initializer=fluid.initializer.UniformInitializer(low=-1.0, high=1.0, seed=0),
learning_rate=1.0,
regularizer=fluid.regularizer.L1Decay(1.0),
trainable=True,
gradient_clip=fluid.clip.GradientClipByNorm(clip_norm=2.0))
x = fluid.layers.data(name='x', shape=[10], dtype='float32')
y_predict = fluid.layers.fc(input=x, size=1, param_attr=w_param_attrs)
是否有提供全局梯度裁剪的op?还是要手动一层一层设置?