Skip to content

1755 improve focal loss#1765

Merged
wyli merged 17 commits into
Project-MONAI:masterfrom
yiheng-wang-nv:1755-modify-focalloss-format
Mar 17, 2021
Merged

1755 improve focal loss#1765
wyli merged 17 commits into
Project-MONAI:masterfrom
yiheng-wang-nv:1755-modify-focalloss-format

Conversation

@yiheng-wang-nv

@yiheng-wang-nv yiheng-wang-nv commented Mar 15, 2021

Copy link
Copy Markdown
Contributor

Signed-off-by: Yiheng Wang vennw@nvidia.com

Fixes #1755 .

Description

Except for unifying the input parameters, some changes are made to make the class more generic:

  • Modify the type of weight parameter form torch.Tensor to a sequence or a single value. It is helpful if users need to input the parameters via a json file.

Status

Ready

Types of changes

  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

@yiheng-wang-nv yiheng-wang-nv changed the title Add to_onehot_y and include_background 1755 improve focal loss Mar 15, 2021
@yiheng-wang-nv yiheng-wang-nv requested a review from wyli March 15, 2021 12:49
yiheng-wang-nv and others added 3 commits March 15, 2021 21:52
Signed-off-by: Yiheng Wang <vennw@nvidia.com>
Signed-off-by: Yiheng Wang <vennw@nvidia.com>
Comment thread monai/losses/focal_loss.py Outdated

@wyli wyli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, I put some comments inline

Comment thread monai/losses/focal_loss.py Outdated
Comment thread monai/losses/focal_loss.py
Comment thread monai/losses/focal_loss.py
Comment thread monai/losses/focal_loss.py
Comment thread tests/test_seg_loss_integration.py
Comment thread tests/test_focal_loss.py

@wyli wyli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@wyli wyli merged commit b868087 into Project-MONAI:master Mar 17, 2021
@yiheng-wang-nv yiheng-wang-nv deleted the 1755-modify-focalloss-format branch July 2, 2021 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unify the input of loss components

2 participants