Skip to content

3872 enhance contrastive loss#3873

Merged
wyli merged 3 commits intoProject-MONAI:devfrom
yiheng-wang-nv:3872-enhance-contrastive
Mar 1, 2022
Merged

3872 enhance contrastive loss#3873
wyli merged 3 commits intoProject-MONAI:devfrom
yiheng-wang-nv:3872-enhance-contrastive

Conversation

@yiheng-wang-nv
Copy link
Copy Markdown
Contributor

Signed-off-by: Yiheng Wang [email protected]

Fixes #3872 .

Description

This PR enhances the contrastive loss via:

  1. Use torch.as_tensor to replace torch.tensor for temperature_tensor.
  2. Remove some duplicate convert type manipulations for negatives_mask.

Status

Ready

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • 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 --disttests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

Signed-off-by: Yiheng Wang <[email protected]>
@wyli wyli enabled auto-merge (squash) March 1, 2022 11:48
@wyli wyli merged commit e45dfad into Project-MONAI:dev Mar 1, 2022
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.

Enhance ContrastiveLoss to avoid warning

2 participants