Skip to content
This repository was archived by the owner on Oct 31, 2023. It is now read-only.
This repository was archived by the owner on Oct 31, 2023. It is now read-only.

the length loss should devide nsentences? #9

@PanXiebit

Description

@PanXiebit

loss = (1. - self.eps) * nll_loss + eps_i * smooth_loss + length_loss

'loss': sum(log.get('loss', 0) for log in logging_outputs) / sample_size / math.log(2),

the total loss is sumed by nll_loss, smooth_loss and length loss. When compute the mean loss, nll_loss, smooth_loss should devide ntokens, and length loss should devide nsentences. However, in the source code, both of them are devided by ntokens?

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