pytorch / pytorch/vision

Add option to choose the loss function in `compute_loss` function.

Open
#5,983 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

module: models topic: object detection
Dominant language
Python
Stars
17.9k
Forks
7.3k
Avg merge
1d 15h
Merged PRs (30d)
13

Description

🚀 The feature

In the compute loss function, giou_loss is used to calculate the loss by default see here, but now as CIOU and DIOU loss functions are added to torchvision, maybe we could let the user choose in between the loss functions

cc @datumbox @YosuaMichael, @NicolasHug,

Motivation, pitch

This gives little more freedom to the user to choose between the loss functions.

Alternatives

No response

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in torchvision/models/detection/fcos.py, especially the compute_loss function and the default giou_loss use around the linked lines. Read how CIOU and DIOU are exposed in torchvision before deciding how the choice should be represented. Done means users can select among the available loss functions while preserving GIoU as the default.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision, machine-learning
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.