summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Long <jonlong@cs.berkeley.edu>2015-09-19 02:56:20 (GMT)
committerJon Long <jonlong@cs.berkeley.edu>2015-09-19 02:56:20 (GMT)
commit68655b55925cfa5cd6543cdfb879bf6e68bd2a3c (patch)
tree92322a694aa32ff14deecc11e7aed2206219b3ff
parent2e1c1cb7788eff438dba6ea77e100e1b3af51104 (diff)
parentf75d594bbec1efab69cdc09c04bed1762aebd0e1 (diff)
downloadcaffeonacl-68655b55925cfa5cd6543cdfb879bf6e68bd2a3c.zip
caffeonacl-68655b55925cfa5cd6543cdfb879bf6e68bd2a3c.tar.gz
caffeonacl-68655b55925cfa5cd6543cdfb879bf6e68bd2a3c.tar.bz2
Merge pull request #3083 from yanchen036/master
refine format of switch case statement in solver
-rw-r--r--include/caffe/solver.hpp14
-rw-r--r--src/caffe/solver.cpp16
2 files changed, 15 insertions, 15 deletions
diff --git a/include/caffe/solver.hpp b/include/caffe/solver.hpp
index 8d52785..2ecf539 100644
--- a/include/caffe/solver.hpp
+++ b/include/caffe/solver.hpp
@@ -283,19 +283,19 @@ Solver<Dtype>* GetSolver(const SolverParameter& param) {
switch (type) {
case SolverParameter_SolverType_SGD:
- return new SGDSolver<Dtype>(param);
+ return new SGDSolver<Dtype>(param);
case SolverParameter_SolverType_NESTEROV:
- return new NesterovSolver<Dtype>(param);
+ return new NesterovSolver<Dtype>(param);
case SolverParameter_SolverType_ADAGRAD:
- return new AdaGradSolver<Dtype>(param);
+ return new AdaGradSolver<Dtype>(param);
case SolverParameter_SolverType_RMSPROP:
- return new RMSPropSolver<Dtype>(param);
+ return new RMSPropSolver<Dtype>(param);
case SolverParameter_SolverType_ADADELTA:
- return new AdaDeltaSolver<Dtype>(param);
+ return new AdaDeltaSolver<Dtype>(param);
case SolverParameter_SolverType_ADAM:
- return new AdamSolver<Dtype>(param);
+ return new AdamSolver<Dtype>(param);
default:
- LOG(FATAL) << "Unknown SolverType: " << type;
+ LOG(FATAL) << "Unknown SolverType: " << type;
}
return (Solver<Dtype>*) NULL;
}
diff --git a/src/caffe/solver.cpp b/src/caffe/solver.cpp
index 3574ce7..12c13dd 100644
--- a/src/caffe/solver.cpp
+++ b/src/caffe/solver.cpp
@@ -422,14 +422,14 @@ void Solver<Dtype>::Snapshot() {
CHECK(Caffe::root_solver());
string model_filename;
switch (param_.snapshot_format()) {
- case caffe::SolverParameter_SnapshotFormat_BINARYPROTO:
- model_filename = SnapshotToBinaryProto();
- break;
- case caffe::SolverParameter_SnapshotFormat_HDF5:
- model_filename = SnapshotToHDF5();
- break;
- default:
- LOG(FATAL) << "Unsupported snapshot format.";
+ case caffe::SolverParameter_SnapshotFormat_BINARYPROTO:
+ model_filename = SnapshotToBinaryProto();
+ break;
+ case caffe::SolverParameter_SnapshotFormat_HDF5:
+ model_filename = SnapshotToHDF5();
+ break;
+ default:
+ LOG(FATAL) << "Unsupported snapshot format.";
}
SnapshotSolverState(model_filename);