Cross Entropy
In a classification task, the end results of a DNN will be a set of a lot of 0s and one 1 which One Hot encodes the class.
To ensure that we have propabilities (ranging from 0 to 1), we apply a softmax transformation.
yiˉ=∑j=1nexpyj^expyi^
Now, the values represent a class probability. To avoid very small numbers, we take the negative log of the result.
−logyiˉ
In a Logistic Regression task we also use cross entropy. In this case we construct the loss with the Log-Likelihood.
ℓ(θ)=i=1∑Nlog[p(yi∣xi,θ)]=⋆i=1∑Nlog(μ(xi,w)yi(1−μ(xi,w))1−yi)
=i=1∑Nyilog(μ(xi,w))+(1−yi)log(1−μ(xi,w))
Now we have to minimize the negative log-likelihood and we have Cross Entropy.
This has a unique minimum but no analytical solution is possible. That is why we use Gradient Descent to get to the minimum.