-
-
Notifications
You must be signed in to change notification settings - Fork 649
add available device to regression tests #3335 #3394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add available device to regression tests #3335 #3394
Conversation
…al_bias.py, test_geometric_mean_absolute_error.py
ae57e4b
to
f99b643
Compare
1b9ee36
to
3dbbe1e
Compare
9b1e5fe
to
b87df91
Compare
b87df91
to
6f0599d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left few comments. Now this PR starts being too large, let's split it and work chunk by chunk.
@vfdev-5 I believe I have addressed your comments, please, review again to make sure everything is ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's split this PR into multiple ones and make them merge once you are done porting 1 or 2 metrics. We want to do the following:
- add available_device
- use tensor API instead of numpy for data creation
- rewrite test_integration tests using pytest parametrize instead of nested _test methods
denom = y_pred_var * y_var | ||
denom = torch.clamp(denom, min=self.eps) | ||
denom = torch.sqrt(denom) | ||
r = cov / denom | ||
|
||
if torch.isnan(r): | ||
return 0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change ? Have you checked with the original implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to make sure I ran the tests once again. Without this snippet, on MPS a division by zero produces NaN:
FAILED tests/ignite/metrics/regression/test_pearson_correlation.py::test_degenerated_sample[mps] - assert 0.0 ± 1.0e-12 == nan
comparison failed
Obtained: nan
Expected: 0.0 ± 1.0e-12
tests/ignite/metrics/regression/test_fractional_absolute_error.py
Outdated
Show resolved
Hide resolved
09d4913
to
346e0e1
Compare
No description provided.