--- /dev/null
+net: "mnist_autoencoder.prototxt"
+test_iter: 50
+test_interval: 100
+test_compute_loss: true
+base_lr: 0.01
+lr_policy: "fixed"
+display: 20
+max_iter: 4000000
+weight_decay: 0.0005
+snapshot: 10000
+snapshot_prefix: "mnist_autoencoder_train"
+momentum: 0.9
+# solver mode: CPU or GPU
+solver_mode: GPU
+solver_type: ADAGRAD
--- /dev/null
+net: "mnist_autoencoder.prototxt"
+test_iter: 50
+test_interval: 100
+test_compute_loss: true
+base_lr: 0.0001
+lr_policy: "fixed"
+display: 20
+max_iter: 4000000
+weight_decay: 0.0005
+snapshot: 10000
+snapshot_prefix: "mnist_autoencoder_train"
+momentum: 0.95
+# solver mode: CPU or GPU
+solver_mode: GPU
+solver_type: NESTEROV
class AdaGradSolver : public SGDSolver<Dtype> {
public:
explicit AdaGradSolver(const SolverParameter& param)
- : SGDSolver<Dtype>(param) {}
+ : SGDSolver<Dtype>(param) { constructor_sanity_check(); }
explicit AdaGradSolver(const string& param_file)
- : SGDSolver<Dtype>(param_file) {}
+ : SGDSolver<Dtype>(param_file) { constructor_sanity_check(); }
protected:
virtual void ComputeUpdateValue();
+ void constructor_sanity_check() {
+ CHECK_EQ(0, this->param_.momentum()) << "Momentum cannot be used with AdaGrad.";
+ }
DISABLE_COPY_AND_ASSIGN(AdaGradSolver);
};