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
results = []
for k in topk:
k = min(outputs.size(1), k)
results.append(torch.mean(avg_precision(outputs, targets)[:k]))
return results
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: Scitator/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: facebookresearch/pytext
Commit Name: e45875cd19f5e9b197405619acef6c0bf863768e
Time: 2020-10-09
Author: arbabu@fb.com
File Name: pytext/models/embeddings/char_embedding.py
Class Name: CharacterEmbedding
Method Name: forward