From 2073fb96cb1645ef9148ef4717a15e49cc57557d Mon Sep 17 00:00:00 2001 From: Yibing Liu Date: Thu, 19 Oct 2017 20:12:31 +0800 Subject: [PATCH] Enable learning rate annealing of Adam Optimizer --- paddle/parameter/FirstOrderOptimizer.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/paddle/parameter/FirstOrderOptimizer.h b/paddle/parameter/FirstOrderOptimizer.h index 895e8d6a6..f157188a4 100644 --- a/paddle/parameter/FirstOrderOptimizer.h +++ b/paddle/parameter/FirstOrderOptimizer.h @@ -265,6 +265,10 @@ public: addParameterType(PARAMETER_SECOND_MOMENTUM); } + virtual void startBatch(int64_t numSamplesProcessed) { + learningRate_ = calcLearningRate(numSamplesProcessed, pass_); + } + virtual void finishBatch() { ++step_; } virtual void update(const VectorPtr vecs[], -- GitLab