Skip to content

Misplacement of arguments in non_saturating_d_loss and non_saturating_gen_loss #84

@sebgao

Description

@sebgao

Although non_saturating_d_loss and non_saturating_gen_loss are not default choices in this codebase, there seems a mistake of argument placement label and input in these two functions, which should be swapped (input and label).

loss_real = torch.mean(F.binary_cross_entropy_with_logits(torch.ones_like(logits_real), logits_real))
loss_fake = torch.mean(F.binary_cross_entropy_with_logits(torch.zeros_like(logits_fake), logits_fake))

return torch.mean(F.binary_cross_entropy_with_logits(torch.ones_like(logit_fake), logit_fake))

Also check https://pytorch.org/docs/stable/generated/torch.nn.BCEWithLogitsLoss.html#torch.nn.BCEWithLogitsLoss.

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