Skip to content

train_dm.py loss function scaled twice by the batch_size and the len(dataloader) #1

Description

@xswang-ai

Hi,

Thank you for this fantastic project and detailed preprocessing pipelines. I really enjoyed reading your paper as well.
One small note on the loss function in /main/case_1_kolmogorov/no_dm/fno/dm/train_dm.py (probably in other train.py) which I think is a trivial issue:
Feel free to correct me but I think the loss function is already averaged over batch size each time you computed loss with the loss.mean(), so the training size averaging formulation is incorrect because you would average it twice

The train_loss accumulation

should be changed to train_loss += loss.item() * l_fidel.shape[0]

I think it would only affect the scale of your results but everything else is all good.
Cheers,
XS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions