where the first column is the epoch number. So if I want to draw the loss per epoch, do I need to average the loss when they have same epoch number? It will be
Epoch Loss
1 (2.173+1.839+1.659+1.600+1.533+1.468)/6
2 ...
I really couldn’t understand this for a long time. I think what Klory is trying to say is this:
If you look at most loss functions (e.g. Cross Entropy Loss) you will see that reduction="mean". This means that the loss is calculated for each item in the batch, summed and then divided by the size of the batch.
If you want to compute the standard loss (without the average) you will need to multiply the mean loss outputted by criterion() with the batch size, which is outputs.shape[0].