Dear Course Instructor,
In the 3rd assignment of Week 1, I am having problem even after correction of dW2 and db1. In the equation additional 2 was multiplied which I removed and in db1 4 ./m was multiplied instead of 1 ./ m. I ran the backward_propagation_n function again after correction and subsequently ran gradient_check_n. Still, I am getting a difference of 1 instead of correct answer. The message is appended here.
Could you please help me why I am getting this problem.
Thank you.
Sincerely,
Sunita
It is a quite rare case to have “difference = 1.0”. It is better for you to check the value of “numerator” and “denominator”. As you see in the instruction, it is;
difference = \frac{\parallel grad - gradapprox \parallel_2}{\parallel grad\parallel_2 + \parallel gradapprox\parallel_2}
If either “grad” or “gradapprox” is "0, this may happen. But, that is not a correct answer.
Yes, exactly as Nobu says, the outcome 1.0 there is very unlikely. Most likely you have implemented a different formula. E.g. perhaps you used either addition or subtraction in both numerator and denominator.
My grad is 3.3851797873981373 but gradapprox is 0. So problem is in gradapprox calculation. By mistake I put + instead of -. That was the problem.
Thank you so much Paulin and Nobu.