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

Method test_exponential_decay_cpu

test/python/test_opt.py:55–60  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

53
54class TestDecayScheduler(unittest.TestCase):
55 def test_exponential_decay_cpu(self):
56 lr = opt.ExponentialDecay(0.1, 2, 0.5, True)
57 sgd1 = opt.SGD(lr=lr)
58 for i in range(5):
59 np.testing.assert_array_almost_equal(tensor.to_numpy(sgd1.lr_value), [0.1*0.5**(i//2)])
60 sgd1.step()
61
62 def test_exponential_decay_no_staircase_cpu(self):
63 lr = opt.ExponentialDecay(0.1, 2, 0.5, False)

Callers

nothing calls this directly

Calls 1

stepMethod · 0.95

Tested by

no test coverage detected