pytorch/ignite

Unify metrics output type

Open

#1,635 创建于 2021年2月12日

在 GitHub 查看
 (12 评论) (0 反应) (0 负责人)Python (602 fork)batch import
HacktoberfestPyDataGlobaldocsenhancementhelp wantedmodule: metricsneeds-discussion

仓库指标

Star
 (4,313 star)
PR 合并指标
 (平均合并 15天 11小时) (30 天内合并 17 个 PR)

描述

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

贡献者指南