MCPcopy Index your code
hub / github.com/pytorch/pytorch / AddParameterUpdate

Function AddParameterUpdate

caffe2/experiments/python/convnet_benchmarks.py:542–550  ·  view source on GitHub ↗

Simple plain SGD update -- not tuned to actually train the models

(model)

Source from the content-addressed store, hash-verified

540
541
542def 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
553def Benchmark(model_gen, arg):

Callers 1

BenchmarkFunction · 0.70

Calls 1

IterMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…