From e53119f5b101ea17926f3e2c93fae40a788eeed7 Mon Sep 17 00:00:00 2001 From: Hongyu Liu <43953930+phlrain@users.noreply.github.com> Date: Fri, 24 May 2019 16:20:22 +0800 Subject: [PATCH] Fix decayed adagrad example (#17390) * fix DecayedAdagrad example; test=develop test=document_preview * add space; test=develop --- python/paddle/fluid/optimizer.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/paddle/fluid/optimizer.py b/python/paddle/fluid/optimizer.py index c4443afb6bd..24bb5a5b3d1 100644 --- a/python/paddle/fluid/optimizer.py +++ b/python/paddle/fluid/optimizer.py @@ -1427,6 +1427,13 @@ class DecayedAdagradOptimizer(Optimizer): Examples: .. code-block:: python + import paddle.fluid as fluid + import paddle.fluid.layers as layers + from paddle.fluid.optimizer import DecayedAdagrad + + x = layers.data( name='x', shape=[-1, 10], dtype='float32' ) + trans = layers.fc( x, 100 ) + cost = layers.reduce_mean( trans ) optimizer = fluid.optimizer.DecayedAdagrad(learning_rate=0.2) optimizer.minimize(cost) -- GitLab