Gradient approx in Gradient Check is not right

Hi,
probably this is really silly but I’m stuck on this.
My gradapprox is wrong and therefore the check is failing.
I’ve been debugging and my gradapprox is around 4, far beyond 2.

first I used the definition of J and did:
J_plus = x * theta_plus

didn’t work. Then I thought about using the previous functions like for instance:
J_minus = forward_propagation(theta_minus, theta)

Still not working. What am I not getting?

Hi, @Edu4rd.

Check the function header for forward_propagation:

def forward_propagation(x, theta):

There may be more errors in gradient_check, since your first approach did not work :thinking:

1 Like

Hi,

thanks for your help. It’s solved now. Lessons learned: Mind the input and output criteria of the functions. Most of my errors can be fixed with this tip.

Cheers!

1 Like