def cross_entropy_error(Y, probas_):
    # compute Cross Entropy using the Natural Log:
    # ( -tln(y) ) − ( (1−t)ln(1−y) )
    probas_class1 = probas_[:, 1]  # get the class 1 probabilities
    # force any 1.0 (100%) probabilities to be fractionally smaller, so
    # np.log(1-1) doesn't generate a NaN
    probas_class1[np.where(probas_class1 == 1.0)] = 0.999999999999999
    probas_class1[np.where(probas_class1 == 0.0)] = 0.000000000000001
    #import pdb; pdb.set_trace()
    cross_entropy_errors = ((-Y) * (np.log(probas_class1))) - ((1 - Y) * (np.log(1 - probas_class1)))
    return cross_entropy_errors
dataset/ETHPy150Open ianozsvald/social_media_brand_disambiguator/learn1_experiments.py/cross_entropy_error/original