open_in_new
content_copy
def CrossEntropy(yHat, y): if y == 1: return -log(yHat) else: return -log(1 - yHat)