Course 2 Week 1 Exercise 3 - gradient_check: difference = 0.0

Hi everyone,

My test result from this exercise shows:


x, theta = 3, 4
difference = gradient_check(x, theta, print_msg=True)

Your backward propagation works perfectly fine! difference = 0.0

And I doubt that I am calling backward_propagation with wrong inputs:

grad = backward_propagation(gradapprox, theta)

Could you advise?

Hi again,

After further look, I made two mistakes:

  1. Equation of “gradapprox”
  2. Equation of “grad” - The input has to be “x” and “theta”

My test passed. :slight_smile:

Regards,
Kana

Hi @Kana_Ikeda ,

Below are a couple of suggestions to check your calculation:

  1. Is the calculation for gradapprox correct? bearing mind that the operator * and / have higher precedence than + and - in the expression, and you need to use parenthesis to enforce the correct order as shown in the formula
  2. what is the value of the numerator and denominator ? use print statement to print the values.
1 Like