Last active
May 15, 2020 10:14
-
-
Save vamc-stash/7a9864c0b73ffdb2a99160c792373d04 to your computer and use it in GitHub Desktop.
Error Estimation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def compute_loss(loss_func, A, Y,i): | |
m = Y.shape[0] | |
A = A.flatten() | |
if loss_func == "binary_crossentropy": | |
cost = (-(Y*np.log(A))-((1-Y)*np.log(1-A))) | |
cost = np.sum(cost,axis=0,keepdims = 1)/m | |
cost = np.squeeze(cost) | |
return cost |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment