C1_W3_Logistic_Regression UNQ_C3

Hello all,
I am having difficulties to visualize where is the problem in my implementation:


GRADED FUNCTION: compute_gradient

The expected output is:

And mine is showing:

UNQ_C1 and UNQ_C2 went well the expected values.
How can I troubleshoot this?

Thanks folks


The most common issue is if you are using a for-loop but don’t have the correct indentation.
Python uses indentation to identify different code blocks.

For example, if you’re computing f_wb by iterating through the features, be careful that you only add ‘b’ once.

It’s also important to keep this in mind when computing the bias gradient and the weight gradients.

1 Like

Check training data set and then run, different values of the gradient differentials might be due to change in input data set , x train y train
The expected values are only earned if you exactly load the actual training data set and provide your own .

Hope this might help you.

1 Like