Skip to content

Issue about updating training loss #2

@hpkhanh1610

Description

@hpkhanh1610

Hi, in the "Transfer_Learning_Solution.ipynb", in the training section part, when we update the training loss, there's a line code as follows:

update training loss
train_loss += loss.item()

While in the other 2 notebooks, which are "cifar10_cnn_solution.ipynb" and "mnist_mlp_solution.ipynb", the updating training loss is as follows:

update training loss
train_loss += loss.item()*data.size(0)

Why is there a difference here? Which one is correct: with data.size(0) or without it?
Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions