f4beaac559e00a3676d942dc7e8fea69efc01cfe,catalyst/metrics/avg_precision.py,,mean_avg_precision,#Any#Any#Any#,74
Before Change
size: [len(top_k), 1]
map_k_tuple = tuple(
torch.mean(avg_precision(outputs, targets, k)).item() for k in top_k
)
return map_k_tuple
After Change
size: len(top_k)
results = []
for k in topk:
k = min(outputs.size(1), k)
results.append(torch.mean(avg_precision(outputs, targets)[:k]))
return results
__all__ = ["mean_avg_precision", "avg_precision"]
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: catalyst-team/catalyst
Commit Name: f4beaac559e00a3676d942dc7e8fea69efc01cfe
Time: 2020-11-30
Author: raveforlive@gmail.com
File Name: catalyst/metrics/avg_precision.py
Class Name:
Method Name: mean_avg_precision
Project Name: NifTK/NiftyNet
Commit Name: 03e8525394683bb5da7668330cd910c87c7d4501
Time: 2017-04-03
Author: l.fidon@ucl.ac.uk
File Name: data_augmentation.py
Class Name:
Method Name: rand_intensity_normalisation
Project Name: deepmipt/DeepPavlov
Commit Name: c672738b39c8f739551da0d88991a2fedfba3e14
Time: 2018-10-04
Author: puleon@mail.ru
File Name: deeppavlov/models/ranking/metrics.py
Class Name:
Method Name: rank_response