def test_power_schedule(backend_default):
 sch = PowerSchedule(step_config=2, change=0.5)
 target_lr = [1.0, 1.0, 0.5, 0.5, 0.25, 0.25, 0.125, 0.125]
 for (e, lr) in enumerate(target_lr):
  assert np.allclose(lr, sch.get_learning_rate(learning_rate=1.0, epoch=e))

def test_power_schedule ( backend_default ) : sch = PowerSchedule ( step_config = 2 , change = 0.5 ) target_lr = [ 1.0 , 1.0 , 0.5 , 0.5 , 0.25 , 0.25 , 0.125 , 0.125 ] for ( e , lr ) in enumerate ( target_lr ) : assert np . allclose ( lr , sch . get_learning_rate ( learning_rate = 1.0 , epoch = e ) )
test the powerschedule class .