You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think there is a clean way of only updating the necessary metrics in the general case (when you're just updating all the metrics yourself), but I think that when you combine your metrics in a collection, it could be useful to only update the "base" metric, instead of all metrics.
Motivation
I often want to use a base metric multiple times, and then I have to be careful not to update too many of them. A somewhat convoluted example (because the f1 score is already implemented) :
prec=Precision()
recall=Recall()
f1=2* (prec*recall) / (prec+recall)
prec.update(pred, gt)
recall.update(pred, gt)
f1.update(pred, gt) # Shouldn't do this, because it updates prec and recall twice.
@Borda Yes, this is necessary at some point. The only question here is: Should we define "compatible" metrics, that share their internal state or should this be defined by the user?
IF we define it, we have to maintain this list, but we know about the implementation details of the metrics. If the user defines it, we don't need to care about that list but expect the user to know about our internals.
🚀 Feature
When updating metrics that are composed of other metrics there are two ways of dealing with updating too many times :
I don't think there is a clean way of only updating the necessary metrics in the general case (when you're just updating all the metrics yourself), but I think that when you combine your metrics in a collection, it could be useful to only update the "base" metric, instead of all metrics.
Motivation
I often want to use a base metric multiple times, and then I have to be careful not to update too many of them. A somewhat convoluted example (because the f1 score is already implemented) :
Pitch
Continuing last example :
This should only update prec and recall once.
Alternatives
The alternative is to always define metrics from scratch, but this causes duplication of computation during the update phase.
The text was updated successfully, but these errors were encountered: