A loss function (also called a cost function) defines the quantity to be minimized in an optimization problem.