Week 1 Assignment 3 Grad Check

Getting an error that there is a mistake in calculating the back prop

gradapprox was 8.00 and grad value was 2

Hi @Shan.ali ,

I am not sure what your J is. Your code didn’t use the backward propagation. So I am not sure what is going on here. Try refresh the kernel and rerun the code from start to see if it would help.

1 Like

Hi Kic,
J comes from the forward propagation function and J = 8. I tried backward propagation, but it still gives error. x equals backward propagation. Rerunning the code still gives the same output

Hi @Shan.ali ,

Your calculations for J_plus and minus are incorrect. Here you should be using the forward_propagation() to work out the value for function J with the change in theta. What you have done is that your J became x, resulting incorrect value.