Loss function used in learner.recorder.plot()

What is the default loss function used in the learner.recorder.plot() function?

1 Like

I haven’t explicitly looked, but I assume it’s the same loss function that’s being used for SGD which your model is trying to minimize. For classification that’s going to cross-entropy. For regression, I believe fastai default is RMSE.

@Patrick That is correct, but the default is Adam not SGD :slight_smile:

@Patrick @muellerzr Where does it specify that though? I’ve looked in the source code learner.recorder() but all I’ve found is the following in the Learner() class:


Is there a way to change the loss function being used by the Learner or the Recorder?

Do a learn.loss_func and it will say Flattened Cross Entropy, the default :slight_smile: and sure! Just do learn.loss_func = whateverlossfunction

Or on cnn_learner do cnn_learner(loss_func=…)

1 Like