Simple plain SGD update -- not tuned to actually train the models
(model)
| 540 | |
| 541 | |
| 542 | def AddParameterUpdate(model): |
| 543 | """ Simple plain SGD update -- not tuned to actually train the models """ |
| 544 | ITER = model.Iter("iter") |
| 545 | LR = model.LearningRate( |
| 546 | ITER, "LR", base_lr=-1e-8, policy="step", stepsize=10000, gamma=0.999) |
| 547 | ONE = model.param_init_net.ConstantFill([], "ONE", shape=[1], value=1.0) |
| 548 | for param in model.params: |
| 549 | param_grad = model.param_to_grad[param] |
| 550 | model.WeightedSum([param, ONE, param_grad, LR], param) |
| 551 | |
| 552 | |
| 553 | def Benchmark(model_gen, arg): |