| 240 | |
| 241 | |
| 242 | inline std::shared_ptr<Optimizer> CreateOptimizer(const string& type) { |
| 243 | std::shared_ptr<Optimizer> opt; |
| 244 | if (type == "SGD") |
| 245 | opt = std::shared_ptr<Optimizer>(new SGD()); |
| 246 | else if (type == "RMSProp") |
| 247 | opt = std::shared_ptr<Optimizer>(new RMSProp()); |
| 248 | else if (type == "AdaGrad") |
| 249 | opt = std::shared_ptr<Optimizer>(new AdaGrad()); |
| 250 | else if (type == "Nesterov") |
| 251 | opt = std::shared_ptr<Optimizer>(new Nesterov()); |
| 252 | else |
| 253 | LOG(FATAL) << "Unknown optimizer type : " << type; |
| 254 | return opt; |
| 255 | } |
| 256 | // ============LocalAllReduce for single node multiple workers ============== |
| 257 | /// Updater for training models on a single node with multiple devices (workers) |
| 258 | /// All model parameters are partitioned such that each parameter is updated on |
nothing calls this directly
no outgoing calls
no test coverage detected