-
Notifications
You must be signed in to change notification settings - Fork 411
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
Metric sweeping #544
Metric sweeping #544
Conversation
Codecov Report
@@ Coverage Diff @@
## master #544 +/- ##
=====================================
- Coverage 95% 95% -0%
=====================================
Files 130 130
Lines 4618 4632 +14
=====================================
+ Hits 4400 4411 +11
- Misses 218 221 +3 |
I think it shall be property so it is not possible to change it, the same as is differentiable... |
Fine with this being a property instead. Only reason I wanted this to be a class attribute was to give the user the possibility of actually getting this value even before the class was initialized. |
@lucadiliello what is the correct value for all our retrieval metrics (you are the expert)? |
Hi @SkafteNicki , all retrieval metrics should have |
that is a good point but in the same light why the we can ban certain attributes from being overwritten as for example: def _ _setattr_ _(self, name, value):
if name in ("higher_is_better", "is_diffrenetiable"):
raise RuntimeError(f"Can't chnage const `{name}`."
self._ _dict_ _[name] = value |
You are completely right. I think we should also change |
Anyone got a better name? On top of my head
cc: @PyTorchLightning/core-metrics @PyTorchLightning/core-contributors |
@Borda please wait with merge, going to add the property to some more metrics |
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.
LGTM !
@SkafteNicki mind check the failing tests on GPU? |
for more information, see https://pre-commit.ci
Before submitting
What does this PR do?
Fixes #148
Introduce the
higher_is_better
static property that determines if a metric is optimal when it is maximized (True
), minimized (False
) or this is undefined (None
).Still missing adding some metrics were I am not sure what the property should be.
cc: @maximsch2
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃