Created
September 1, 2019 14:33
-
-
Save RobertTLange/5432a0c0ad9f96275c36aa53475c2f17 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 binary_cross_entropy(y_true, y_pred): | |
| y_true = np.append(1 - y_true, y_true, axis=1) | |
| y_pred = np.append(1 - y_pred, y_pred, axis=1) | |
| bce = -(y_true * np.log(y_pred)).sum(axis=1) | |
| return bce |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment