ABSTRACT

The concept of a loss function is essential to machine learning. At any iteration, the current loss value indicates how far the estimate is from the target. It is then used to update the parameters in a direction that will decrease the loss. In this final conceptual chapter before we re-factor our running examples, we want to talk about two things: First, how to make use of torch's built-in loss functions. And second, what function to choose. In deep learning, or machine learning overall, most applications aim to do one of two things: predict a numerical value, or estimate a probability. The regression task of our running example does the former; real-world applications might forecast temperatures, infer employee churn, or predict sales. In the second group, the prototypical task is classification. The second step, the one that was not required in the binary case, consists in transforming the probabilities to log probabilities.