summaryrefslogtreecommitdiff
path: root/training/online_optimizer.cc
diff options
context:
space:
mode:
authorredpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-29 00:36:09 +0000
committerredpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-29 00:36:09 +0000
commit594cc714737708bb7c90c24a1ab1537b052f45ee (patch)
treec3dca78e6c28379736f4b663e5c94b9dc40975cf /training/online_optimizer.cc
parent016b376714976bbf19510e07797c9787f29daf60 (diff)
online optimizer
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@631 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'training/online_optimizer.cc')
-rw-r--r--training/online_optimizer.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/training/online_optimizer.cc b/training/online_optimizer.cc
new file mode 100644
index 00000000..db55c95e
--- /dev/null
+++ b/training/online_optimizer.cc
@@ -0,0 +1,14 @@
+#include "online_optimizer.h"
+
+LearningRateSchedule::~LearningRateSchedule() {}
+
+double StandardLearningRate::eta(int k) const {
+ return eta_0_ / (1.0 + k / N_);
+}
+
+double ExponentialDecayLearningRate::eta(int k) const {
+ return eta_0_ * pow(alpha_, k / N_);
+}
+
+OnlineOptimizer::~OnlineOptimizer() {}
+