Skip to content

Misleading example for per-sample gradient #2827

@mingfeisun

Description

@mingfeisun

In the example of per-sample gradient, the following line can be misleading since the predictions of a net are logits:

return F.nll_loss(predictions, targets)

The correct way should be:

return F.nll_loss(F.log_softmax(predictions, dim=-1), targets) 

Would appreciate if this can be corrected.

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