Skip to content

Bug: Monitor does not record the loss of the whole epoch #34

@lfrommelt

Description

@lfrommelt

The monitor logs the train loss after each epoch. However, it does not log the loss of the complete epoch, but instead the loss of the last sampled mini-batch. This way, the stochasticity of the shuffling of the dataset can make the resulting plots quite messy.

Train loss as it is implemented

Image

Train loss of the same run, but taken on the whole train set

Image

Most libraries that I know of, solve this problem without an increase in runtime in a way similat to changing self.current_loss = loss.item() with self.current_loss += loss.item()/n_batches and setting this value to zero at the beginning of each epoch.

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