-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Deprecate compute_on_step
#789
Comments
I do not have any very strong opinion, I feel we can deprecate it... 🐰 |
@SkafteNicki - n00b question: why should forward call update vs the functional definition of the metric if available? |
@ananthsub forward will still have a double purpose of both returning the metric on the current batch and adding to the global metric state. So this will be the recommend way to do things in TM:
|
@SkafteNicki would this be the pseudocode for def forward(*args, **args):
self.update(*args, **args)
return fn(*args, **args) |
Hi, can you please explain a little bit what is the difference between functional call and forward? I'm still not quite sure about all the details regarding metrics evaluation, e.g. I thought that |
+1 to this comment. Seems like,
Is this right? |
Yes, that is completely right :] |
🚀 Feature
Deprecate
compute_on_step
argument in all modular metrics.Motivation
Setting
compute_on_step
argument toFalse
essentially turnforward
intoupdate
, since this is the only code that is then being executed:https://github.com/PyTorchLightning/metrics/blob/5b6cb1d0e735544e6c42cc39bbe7eb29561b75e1/torchmetrics/metric.py#L204-L205
It is sometimes a good thing to have multiple ways of doing certain operations, however in this case IMO it will be much more clear to the user that
update
always do not return anything andforward
always returns something.Pitch
The flag have been there since the beginning, but we as we are now starting the process of refactoring it is worth considering if it should still be part of the framework when it just adds a duplicate of a feature we already have.
Alternatives
Additional context
The text was updated successfully, but these errors were encountered: