pytorch/ignite

Unify metrics output type

Aperta

#1635 aperta il 12 feb 2021

 (12 commenti) (0 reazioni) (0 assegnatari)Python (602 fork)batch import
HacktoberfestPyDataGlobaldocsenhancementhelp wantedmodule: metricsneeds-discussion

Metriche repository

Star
 (4313 stelle)
Metriche merge PR
 (Merge medio 18g 23h) (19 PR mergiate in 30 g)

Descrizione

🚀 Feature

The idea is to verify the output type for all metrics (output of compute function) and update the docs accordingly.

In general, metric's output should be a float number. In some particular cases, like Recall/Precision with average=False, the output is a torch tensor. So, let's see and decide if the output of compute() method can be :

  • def compute() -> float
  • def compute() -> Union[float, torch.Tensor] and tensor is on CPU
  • def compute() -> torch.Tensor with tensor on CPU

To address this FR, we have to make sure for each metric what kind of type it supposes to return and update the docs accordingly.

Guida contributor