C2-W2 Excercise 8

I get the results:
Original learning rate: 0.5
Updated learning rate after 10 epochs: 0.4854368932038835
Updated learning rate after 100 epochs: 0.3846153846153846

However the expected results are:
Original learning rate: 0.5
Updated learning rate after 10 epochs: 0.5
Updated learning rate after 100 epochs: 0.3846153846153846

How come the results after 10 epochs don’t change? They seem they should change. For the record I am uisng the following line to calculate learning_rate:

{moderator edit - solution code removed}

You missed one subtlety in the mathematical formula that they gave you: the symbols \lfloor and \rfloor mean the mathematical “floor” function.

Thank you, although I am not really sure what is the purpose of the floor function here but it worked.
Thanks.

If you think about the goal of the calculation, it is to change the learning rate not on every epoch but only periodically every time_interval epochs. So think about what that formula would do if you omit the “floor” function: the fraction would change on every epoch, right?