Metric computation not needed in loss_batch during training

If I am understanding correctly in basic_train.py L25: https://github.com/fastai/fastai_v1/blob/master/fastai/basic_train.py#L25, metrics are being computed for each batch even during training which is called in L71: https://github.com/fastai/fastai_v1/blob/master/fastai/basic_train.py#L71

However, we need metrics only during validation and not training.

No, the call to loss_batch during the training dl doesn’t include metrics (second line you quoted), so it defaults to None which means the line in loss_batch isn’t executed.

1 Like

Ah my bad, didn’t note that it was None

1 Like