summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 27c2537)
raw | patch | inline | side by side (parent: 27c2537)
author | Yangqing Jia <jiayq84@gmail.com> | |
Sat, 26 Oct 2013 00:32:36 +0000 (17:32 -0700) | ||
committer | Yangqing Jia <jiayq84@gmail.com> | |
Sat, 26 Oct 2013 00:32:36 +0000 (17:32 -0700) |
include/caffe/solver.hpp | patch | blob | history | |
src/caffe/proto/caffe.proto | patch | blob | history | |
src/caffe/solver.cpp | patch | blob | history |
index 98c872dc21d573f1f3b70c9f8ab4212ac88e80f3..2055ab6b24c5e42bf1d8d1360d6d53ab18038bed 100644 (file)
--- a/include/caffe/solver.hpp
+++ b/include/caffe/solver.hpp
protected:
virtual void PreSolve();
- virtual Dtype GetLearningRate();
+ Dtype GetLearningRate();
virtual void ComputeUpdateValue();
virtual void SnapshotSolverState(SolverState * state);
virtual void RestoreSolverState(const SolverState& state);
// history maintains the historical momentum data.
vector<shared_ptr<Blob<Dtype> > > history_;
+
+ DISABLE_COPY_AND_ASSIGN(SGDSolver);
};
index 45f21981b47f5eb3574f9afe005f05ed76bfba0c..22716a1873153fae7334f310804e67aee16ed255 100644 (file)
// whether to snapshot diff in the results or not. Snapshotting diff will help
// debugging but the final protocol buffer size will be much larger.
optional bool snapshot_diff = 14 [ default = false];
- // Adagrad solver parameters
- // For Adagrad, we will first run normal sgd using the sgd parameters above
- // for adagrad_skip iterations, and then kick in the adagrad algorithm, with
- // the learning rate being adagrad_gamma * adagrad_skip. Note that the adagrad
- // algorithm will NOT use the learning rate multiplier that is specified in
- // the layer parameter specifications, as it will adjust the learning rate
- // of individual parameters in a data-dependent way.
- // WORK IN PROGRESS: not actually implemented yet.
- optional float adagrad_gamma = 15; // adagrad learning rate multiplier
- optional float adagrad_skip = 16; // the steps to skip before adagrad kicks in
}
// A message that stores the solver snapshots
diff --git a/src/caffe/solver.cpp b/src/caffe/solver.cpp
index 87c346f7036bd32a29d6364cc619efcd3ea2d7e2..bf4bdbc620a7aa96a7adfef2e0d27075a575bdd6 100644 (file)
--- a/src/caffe/solver.cpp
+++ b/src/caffe/solver.cpp
template <typename Dtype>
void SGDSolver<Dtype>::PreSolve() {
- // First of all, see if we need to initialize the history
+ // Initialize the history
vector<shared_ptr<Blob<Dtype> > >& net_params = this->net_->params();
history_.clear();
for (int i = 0; i < net_params.size(); ++i) {