Course 2- Week 2 Assignment- errors in the code after submission

I am getting this errors in my grader notes; can anyone shed some light on what am I missing?

The following cell failed:

learning_rate = 0.5
print("Original learning rate: ", learning_rate)
epoch_num = 2
decay_rate = 1
learning_rate_2 = update_lr(learning_rate, epoch_num, decay_rate)

print("Updated learning rate: ", learning_rate_2)

update_lr_test(update_lr)

The error was:

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-22-32d0cad28578> in <module>
      7 print("Updated learning rate: ", learning_rate_2)
      8 
----> 9 update_lr_test(update_lr)

~/work/submitted/courseraLearner/W2A1/public_tests.py in update_lr_test(target)
    270     output = target(learning_rate, epoch_num, decay_rate)
    271 
--> 272     assert np.isclose(output, expected_output), f"output: {output} expected...
    273     print("\033[92mAll test passed")
    274 

AssertionError: output: 0.5 expected: 0.16666666666666666

==========================================================================================
The following cell failed:

learning_rate = 0.5
print("Original learning rate: ", learning_rate)

epoch_num_1 = 10
epoch_num_2 = 100
decay_rate = 0.3
time_interval = 100
learning_rate_1 = schedule_lr_decay(learning_rate, epoch_num_1, decay_rate, time_in...
learning_rate_2 = schedule_lr_decay(learning_rate, epoch_num_2, decay_rate, time_in...
print("Updated learning rate after {} epochs: ".format(epoch_num_1), learning_rate_...
print("Updated learning rate after {} epochs: ".format(epoch_num_2), learning_rate_...

schedule_lr_decay_test(schedule_lr_decay)

The error was:

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-25-1b8d727c069a> in <module>
     11 print("Updated learning rate after {} epochs: ".format(epoch_num_2), learni...
     12 
---> 13 schedule_lr_decay_test(schedule_lr_decay)

~/work/submitted/courseraLearner/W2A1/public_tests.py in schedule_lr_decay_test(tar...
    286 
    287 
--> 288     assert np.isclose(output_1, expected_output_1),f"output: {output_1} exp...
    289     assert np.isclose(output_2, expected_output_2),f"output: {output_2} exp...
    290 

AssertionError: output: 0.5 expected: 0.25

figured … I missed the last part of the exercise :s

1 Like