def test_decay_steps_value(self): decay_steps_e = -2 with pytest.raises(ValueError): lr_schedules.ExponentialDecayLR(learning_rate, decay_rate, decay_steps_e) with pytest.raises(ValueError): lr_schedules.CosineDecayLR(min_lr, max_lr, decay_steps_e) with pytest.raises(ValueError): lr_schedules.PolynomialDecayLR(learning_rate, end_learning_rate, decay_steps_e, power)
def test_max_lr_value(self): max_lr1 = -1.0 with pytest.raises(ValueError): lr_schedules.CosineDecayLR(min_lr, max_lr1, decay_steps)
def test_cosine_decay(): lr_schedule = lr_schedules.CosineDecayLR(min_lr, max_lr, decay_steps) _executor.compile(lr_schedule, global_step)
def test_max_lr_type(self): max_lr1 = 'a' with pytest.raises(TypeError): lr_schedules.CosineDecayLR(min_lr, max_lr1, decay_steps)