def cross_entropy(prob1, prob2, eps=1e-10):
    """
    Compute cross-entropy between two probability distributions.

    :param prob1: First probability distribution.
    :type prob1: `np.ndarray`
    :param prob2: Second probability distribution.
    :type prob2: `np.ndarray`
    :param eps: A small amount to avoid the possibility of having a log of zero.
    :type eps: `float`
    :return: Cross entropy.
    :rtype: `float`
    """
    prob1 = np.clip(prob1, eps, 1.0 - eps)
    size = prob1.shape[0]
    result = -np.sum(prob2 * np.log(prob1 + eps)) / size

    return result

    Compute cross-entropy between two probability distributions.

    :param prob1: First probability distribution.
    :type prob1: `np.ndarray`
    :param prob2: Second probability distribution.
    :type prob2: `np.ndarray`
    :param eps: A small amount to avoid the possibility of having a log of zero.
    :type eps: `float`
    :return: Cross entropy.
    :rtype: `float`
    
tests/defences/test_defensive_distillation.py