Running loss missunderstand

Hello, I am working on a simple example of MNIST, I can’t understand why running loss is used , and what the meaning of this line"

“running_loss += F.nll_loss(output,target,size_average=False).data[0]”

It looks like the summed loss is being accumulated in running_loss, which will most likely be divided by the number of samples at a later point.
Where did you find this line of code? It looks a bit out-dated, as the usage of .data is not recommended anymore and the argument size_average was replaced by reduction.

1 Like