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

Function AddParameterUpdate

caffe2/python/convnet_benchmarks.py:566–574  ·  view source on GitHub ↗

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

(model)

Source from the content-addressed store, hash-verified

564
565
566def 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
577def Benchmark(model_gen, arg):

Callers 1

BenchmarkFunction · 0.70

Calls 1

iterMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…