Simple plain SGD update -- not tuned to actually train the models
(model)
| 564 | |
| 565 | |
| 566 | def AddParameterUpdate(model): |
| 567 | """ Simple plain SGD update -- not tuned to actually train the models """ |
| 568 | ITER = brew.iter(model, "iter") |
| 569 | LR = model.net.LearningRate( |
| 570 | ITER, "LR", base_lr=-1e-8, policy="step", stepsize=10000, gamma=0.999) |
| 571 | ONE = model.param_init_net.ConstantFill([], "ONE", shape=[1], value=1.0) |
| 572 | for param in model.params: |
| 573 | param_grad = model.param_to_grad[param] |
| 574 | model.net.WeightedSum([param, ONE, param_grad, LR], param) |
| 575 | |
| 576 | |
| 577 | def Benchmark(model_gen, arg): |