Entropy H(p) = minus the sum of p(x) log p(x): the average uncertainty or information (in bits with log base 2) of a distribution; it is maximal for a uniform distribution and zero for a certain outcome.
A fair coin has 1 bit of entropy; a coin that lands heads 90% of the time has about 0.47 bits, since outcomes are more predictable.
Cross-entropy H(p, q) = minus the sum of p(x) log q(x): the average number of bits needed to encode events from the true distribution p using a code built for q.
It is used as the classification loss, with p the true labels and q the model's predicted probabilities.
Loading…