提交 41f04e5a 编写于 作者: H hedaoyuan

Add regularization and model_average

上级 3a5f98c3
......@@ -160,7 +160,10 @@ if __name__ == '__main__':
# create parameters
parameters = paddle.parameters.create(cost)
adam_optimizer = paddle.optimizer.Adam(learning_rate=0.01)
adam_optimizer = paddle.optimizer.Adam(
learning_rate=2e-3,
regularization=paddle.optimizer.L2Regularization(rate=8e-4),
model_average=paddle.optimizer.ModelAverage(average_window=0.5))
def event_handler(event):
if isinstance(event, paddle.event.EndIteration):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册