C1_W3_Logistic_Regression_Cost at initial w not matching

Hi, I’m working through the last lab for course 1 but I’m stuck on 2.4 Cost function for logistic regression, Exercise 2. I can’t get my cost at initial w (zeros) to match up with the expected output of 0.693, any advice would be greatly appreciated. I even used the hints but I’m still getting 0.007 and not 0.693 Thanks!

(Code removed)

Hi!

I noticed that there are some indentation issues with the code.
Unlike most languages Python is Indentation sensitive see here

For example the first loop for i in range(m): currently sets z_wb = 0 m times and nothing else is executed in that loop.

Please review the indentation / control flow of the loops and I think you will be able to get the answer.

Good Luck!

Thank you, I appreciate the help, that worked for me!

Nice! @danderson, now that you have this resolved, I’ve removed the code from your original post since it is against the community guidelines to share any code that might be related to assignments.

hi i am also getting the same error