C1_W3_Logistic_Regression_ex3

Hello!
I’ve been stuck on this error for long time. Used all the hints and also checked other people suggestions on similar error but I must be missing something very simple here, anyone could help?

@Katarzyna_O

I believe all you need is to just normalize the \frac{\partial J}{\partial w} which is done by dividing by the number of examples m.

recall that the derivative of the cost function J with respect to the weights is calculated with this equation.

\frac{\partial J}{\partial w} = \frac{1}{m} \sum_{i=0}^{m} (f(x) - y) x

However, -44.33135 / 4 isn’t going to give the required value of -12.0092.

@Katarzyna_O
(edited reply)

Check for errors in the math for computing dj_dw_ij.
Hint: Parenthesis grouping is important.

1 Like

@Katarzyna_O , since you have used all the hints and checked other people’s suggestions, I will venture to say: check your sigmoid function. All other things properly set, that is the only part of the code that is not a straight-forward formula in this function, so may be the problem is there. Again, this is assuming that all other lines of code are ok. If this doesn’t work you can send me a direct message with your code and I’ll check it out and try to provide an additional hint.

1 Like

@Juan_Olano, I reviewed the student’s code, it had a mis-placed closing parenthesis in the equation for the gradients.