Skip to content

FocalLoss without logits and as class #5762

@ori-kishony

Description

@ori-kishony

🚀 The feature

Making the focal loss api similar to BCE api. In which the difference between BCELoss and BCELossWithLogits is clear and is made as a class as well as a function.

Motivation, pitch

When using a model that explicitly uses the sigmoid activation at the end it is useful to be able to simply use focal loss without injecting the loss before this activation. The use of focal loss in the similar way to BCELoss as a class would also be more elegant and concise.

Alternatives

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions