<gh_stars>0
import numpy as np


def relu(x):
    return np.maximum(0, x)


def logexp(x):
    return np.where(x > 100, x, np.log(1 + np.exp(x)))


def binary_cross_entropy(x, y):
    loss = y * logexp(-x) + (1 - y) * logexp(x)
    return loss
