MCPcopy Create free account
hub / github.com/apache/singa / test_sgd_const_lr

Method test_sgd_const_lr

test/python/test_opt.py:97–107  ·  view source on GitHub ↗
(self, dev=cpu_dev)

Source from the content-addressed store, hash-verified

95
96 @on_cpu_gpu
97 def test_sgd_const_lr(self, dev=cpu_dev):
98 cpu_dev.EnableGraph(False)
99 sgd1 = opt.SGD(lr=0.1)
100 w_shape=(2,3)
101 w = tensor.Tensor(w_shape, device=dev).set_value(0.1)
102 g = tensor.Tensor(w_shape, device=dev).set_value(0.1)
103
104 w_step1 = w-0.1*g
105 sgd1.apply(w.name, w, g)
106
107 assertTensorEqual(w, w_step1)
108
109 @on_cpu_gpu
110 def test_RMSProp_const_lr(self, dev=cpu_dev):

Callers

nothing calls this directly

Calls 5

applyMethod · 0.95
assertTensorEqualFunction · 0.85
EnableGraphMethod · 0.80
TensorMethod · 0.80
set_valueMethod · 0.45

Tested by

no test coverage detected