pytorch / examples

A set of examples around pytorch in Vision, Text, Reinforcement Learning, etc.

Home Page:https://pytorch.org/examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Query on loss calculation in word language model

AvisP opened this issue · comments

commented

In the main.py of word language model, I find that in the evaluate function the total_loss is getting multiplied by length of data

total_loss += len(data) * criterion(output, targets).item()

However in the train function, total_loss is not getting multiplied by length of data

total_loss += loss.item()

Is this proper?