Skip to content

Instantly share code, notes, and snippets.

@mdhasanai
Created November 11, 2018 07:50
Show Gist options
  • Save mdhasanai/3dc2b7c5682e8f358dfe957756cd33e2 to your computer and use it in GitHub Desktop.
Save mdhasanai/3dc2b7c5682e8f358dfe957756cd33e2 to your computer and use it in GitHub Desktop.
def compute_error(a3, Y):
m = Y.shape[0]
logprobs = np.multiply(-np.log(a3),Y) + np.multiply(-np.log(1 - a3), 1 - Y)
cost = 1./m * np.sum(logprobs)
return cost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment