And if the question is why we want the sum instead of the mean loss, that is explained on this thread.