MLS Course 1 W3 Practice Lab Exercise 2

I have a problem with course 1 week 3 practice lab, exercise 2. My output does not match the expected output. Can anyone help, please?

Thanks!

Hello @Ayse_Nehir_Cevik Welcome to the community!
In your problem, Firstly you should have to complete the code of compute_cost function perfectly. Like summation of cost for all training example and divide by training sample (m).
Here use the equations to complete the compute_cost function:
š‘™š‘œš‘ š‘ (š‘“š°,š‘(š±(š‘–)),š‘¦(š‘–)) = (āˆ’š‘¦(š‘–)log(š‘“š°,š‘(š±(š‘–)))āˆ’(1āˆ’š‘¦(š‘–))log(1āˆ’š‘“š°,š‘(š±(š‘–)))
š‘“š°,š‘(š±(š‘–)) = š‘”(š°ā‹…š±(š¢)+š‘), where g is the sigmoid function

Pseudocode:
Initialize loss equal to zero
for ith training example to total training example:
š‘“š°,š‘(š±(š‘–)) = š‘”(š°ā‹…š±(š¢)+š‘) [for multiply use numpy.dot() function]
š‘™š‘œš‘ š‘ (š‘“š°,š‘(š±(š‘–)),š‘¦(š‘–)) += (āˆ’š‘¦(š‘–)log(š‘“š°,š‘(š±(š‘–)))āˆ’(1āˆ’š‘¦(š‘–))log(1āˆ’š‘“š°,š‘(š±(š‘–)))
return cost/m

Hi! Thanks a lot for your help! I tried to code as I can the way you wrote. But unfortunately, the output is still not right. I assume I have done something wrong in the code.