just a question, if we write running_loss += loss.item() after an update of the parameters, I think like that we calculate these:
for epoch in range(5):
running_loss = 0     #accumulates loss of each batch
for x,y in trainloader:
running_loss += loss.item() <=>   F*  = F(x,y, w_{0})+ F(x,y, w_{1})+F(x,y, w_{2})+…
in an epoch  with F isobjective function.
however our objective function defined by :
F(data,w) = F(x,y, w)+ F(x,y,w)+F(x,y,w)+…  for (x,y) in data