pytorch / torcheval

A library that contains a rich collection of performant PyTorch model metrics, a simple interface to create new metrics, a toolkit to facilitate metric computation in distributed training and tools for PyTorch model evaluations.
https://pytorch.org/torcheval
Other
211 stars 46 forks source link

Fix the problem where argument k wasn't passed on for topk_multilabel_accuracy #165

Closed Connor-Guo closed 1 year ago

Connor-Guo commented 1 year ago

Summary: File changed: torcheval/metrics/functional/classification/accuracy.py

In function _topk_multilabel_accuracy_update(input, target, criteria, k): The parameter k should be passed on to input.topk(k, dim). However, the original version passed a fixed value 2 to input.topk(k, dim), instead of the parameter k.

Also, the Examples in docstring of topk_multilabel_accuracy() is edited for consistency.

codecov[bot] commented 1 year ago

Codecov Report

Merging #165 (8710970) into main (c4183d1) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #165   +/-   ##
=======================================
  Coverage   24.23%   24.23%           
=======================================
  Files         178      178           
  Lines       10630    10630           
=======================================
  Hits         2576     2576           
  Misses       8054     8054           
Impacted Files Coverage Δ
...eval/metrics/functional/classification/accuracy.py 20.16% <ø> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

facebook-github-bot commented 1 year ago

@ananthsub has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.