Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix stability in bce with pos_weight formula#13863

Closed
ailzhang wants to merge 4 commits into
pytorch:masterfrom
ailzhang:fix_bce_stability
Closed

fix stability in bce with pos_weight formula#13863
ailzhang wants to merge 4 commits into
pytorch:masterfrom
ailzhang:fix_bce_stability

Conversation

@ailzhang
Copy link
Copy Markdown
Contributor

Fixes #13773

@ailzhang ailzhang changed the title fix stability in formula fix stability in bce with pos_weight formula Nov 12, 2018
Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@ailzhang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@ailzhang
Copy link
Copy Markdown
Contributor Author

@pytorchbot retest this please

Copy link
Copy Markdown
Collaborator

@ssnl ssnl left a comment

Choose a reason for hiding this comment

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

test?

Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@ailzhang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@ailzhang
Copy link
Copy Markdown
Contributor Author

@ssnl Added! ;)

Comment thread test/test_nn.py Outdated
pos_weight = torch.tensor([1., 1.])

out1 = nn.BCEWithLogitsLoss()(output, target)
self.assertTrue(torch.isfinite(out1))

This comment was marked as off-topic.

Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@ailzhang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Copy Markdown
Collaborator

@ssnl ssnl left a comment

Choose a reason for hiding this comment

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

lgtm. merge if ci passes

zdevito pushed a commit to zdevito/ATen that referenced this pull request Nov 13, 2018
Summary:
Fixes #13773
Pull Request resolved: pytorch/pytorch#13863

Differential Revision: D13031803

Pulled By: ailzhang

fbshipit-source-id: 6c9e044f0450eebf4555bbc02c125713d9378e2f
@ezyang ezyang added the merged label Jun 25, 2019
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
Fixes pytorch#13773
Pull Request resolved: pytorch#13863

Differential Revision: D13031803

Pulled By: ailzhang

fbshipit-source-id: 6c9e044f0450eebf4555bbc02c125713d9378e2f
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.

Specifying pos_weight in F.binary_cross_entropy_with_logits may lead to NaN

5 participants