def test_shift_schedule(backend_default):
 lr_init = 0.1
 interval = 1
 sch = ShiftSchedule(interval)
 for epoch in range(10):
  lr = sch.get_learning_rate(learning_rate=lr_init, epoch=epoch)
  assert np.allclose(lr, (lr_init / (2 ** epoch)))

def test_shift_schedule ( backend_default ) : lr_init = 0.1 interval = 1 sch = ShiftSchedule ( interval ) for epoch in range ( 10 ) : lr = sch . get_learning_rate ( learning_rate = lr_init , epoch = epoch ) assert np . allclose ( lr , ( lr_init / ( 2 ** epoch ) ) )
test binary shift learning rate schedule .