Skip to content

Update test_precision_recall_curve.py#2655

Merged
vfdev-5 merged 5 commits intopytorch:masterfrom
puhuk:test_precision_recall_curve
Aug 19, 2022
Merged

Update test_precision_recall_curve.py#2655
vfdev-5 merged 5 commits intopytorch:masterfrom
puhuk:test_precision_recall_curve

Conversation

@puhuk
Copy link
Copy Markdown
Contributor

@puhuk puhuk commented Aug 19, 2022

Description: Update for ddp config for updating in batch way

Check list:

  • New tests are added (if a new feature is added)
  • New doc strings: description and/or example code are in RST format
  • Documentation is updated (if required)

Update for ddp config for updating in batch way
Copy link
Copy Markdown
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

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

Few nits to fix, otherwise lgtm. Thanks !

@vfdev-5 vfdev-5 mentioned this pull request Aug 19, 2022
3 tasks
revert to previous way for generating data
vfdev-5
vfdev-5 previously approved these changes Aug 19, 2022
Copy link
Copy Markdown
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks !

assert precision_recall_curve(np_y, np_y_pred)[2] == pytest.approx(res[2].cpu().numpy())

def get_test_cases():
torch.manual_seed(12 + rank)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@vfdev-5 I don't understand why outer loop does not work when seed is set here. with get_test_cases. It generates as expected. May I ask you to explain a little bit more.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Outer loop works but we generate the same data 3 times which useless

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, ok let me check again and correct it.

@vfdev-5 vfdev-5 dismissed their stale review August 19, 2022 08:32

Remain one issue with redundant loop

Copy link
Copy Markdown
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

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

Thanks @puhuk !

@vfdev-5 vfdev-5 enabled auto-merge (squash) August 19, 2022 14:34
@vfdev-5 vfdev-5 merged commit 1d868a1 into pytorch:master Aug 19, 2022
vfdev-5 added a commit to vfdev-5/ignite that referenced this pull request Aug 22, 2022
* Update test_precision_recall_curve.py

Update for ddp config for updating in batch way

* Update test_precision_recall_curve.py

revert to previous way for generating data

* Update test_precision_recall_curve.py

To generate different data

* Update test_precision_recall_curve.py

Co-authored-by: vfdev <[email protected]>
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.

2 participants