pytorch/ignite

Unify metrics output type

Open

#1.635 aberto em 12 de fev. de 2021

Ver no GitHub
 (12 comments) (0 reactions) (0 assignees)Python (602 forks)batch import
HacktoberfestPyDataGlobaldocsenhancementhelp wantedmodule: metricsneeds-discussion

Métricas do repositório

Stars
 (4.313 stars)
Métricas de merge de PR
 (Mesclagem média 15d 11h) (17 fundiu PRs em 30d)

Description

🚀 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.

Guia do colaborador