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