f4beaac559e00a3676d942dc7e8fea69efc01cfe,catalyst/metrics/avg_precision.py,,mean_avg_precision,#Any#Any#Any#,74

Before Change


            The map score for every k.
            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


__all__ = ["mean_avg_precision", "avg_precision"]

After Change


            The map score for every k.
            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"]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

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: OpenNMT/OpenNMT-py
Commit Name: 68fbfd1876c367323acf830736bae1af499cc0fe
Time: 2018-03-07
Author: dengyuntian@gmail.com
File Name: onmt/io/TextDataset.py
Class Name: TextDataset
Method Name: __init__


Project Name: keras-team/keras
Commit Name: bf464d7ed9283988fea1f548a11a0171fd2ff364
Time: 2021-01-06
Author: gardener@tensorflow.org
File Name: keras/utils/version_utils.py
Class Name:
Method Name: swap_class