pytorch/ignite

Unify metrics output type

開放

#1,635 建立於 2021年2月12日

 (12 則留言) (0 個反應) (0 位負責人)Python (602 個分叉)batch import
HacktoberfestPyDataGlobaldocsenhancementhelp wantedmodule: metricsneeds-discussion

倉庫指標

星標
 (4,313 顆星)
PR 合併指標
 (平均合併 18天 23小時) (30 天內合併 19 個 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.

貢獻者指南