Converted log loss formula in code correctly but the output of test is worng. (screenshots and code is attached below))

Can you tell me why am i not getting the expected output ?

{moderator edit - solution code removed}

This is the test for expected output

print("cost = " + str(compute_cost(A2, Y)))  #Code Output : cost = 0.34657359027997264, # Expeted Output: cost = 0.6931477703826823

Please check the matching of the parentheses on the line that computes logloss. They don’t look right to my eyes anyway.

1 Like