Loss Calculation using Mini Batches

(Sahil Verma) #1

Hi All,

The validation loss is calculated as the average loss over all the mini batches. Code for reference is :https://github.com/fastai/fastai/blob/master/fastai/basic_train.py#L49

My questions are:

  1. Do we follow the same for train loss i.e. average all the losses over minibatches? This is required for reporting after every epoch
  2. Why don’t we calculate the loss on the entire validation data(predict on the whole validation data and get the loss) at the end of every epoch?