Hello, any help please in the C1W2, my implementation is good but i do not find the expected output

Hello, any help please? For ex 2 I compute the gradient correctly but when I compute and display the gradient with w initialized to zeroes I do not get the expected output.

Similar pb with cost and gradient with non-zero w and, my w and b found by gradient descent are not the expected ones. However my implementation in ex 1 is correct.

{moderator edit: code removed}

Please don’t post your code on the forum. That isn’t allowed by the course’s community standards.

If a mentor wants to see your code, they’ll ask you to send it via a private message.

Your code doesn’t have the correct indentation. There is a block that is outside the for-loop of the examples - so your dj_dw_i and dj_db_i are getting overwritten and are unused on each iteration.

Thank you! Sorry about that