7ce6642f777e9da6249bd5b05330d57fa09ea37a,pose/utils/evaluation.py,,dist_acc,#Any#Any#,44
Before Change
def dist_acc(dists, thr=0.5):
""" Return percentage below threshold while ignoring values with a -1 """
if dists.ne(-1).sum() > 0:
return dists.le(thr).eq(dists.ne(-1)).sum()*1.0 / dists.ne(-1).sum()
else:
return -1
def accuracy(output, target, idxs, thr=0.5):
After Change
def dist_acc(dist, thr=0.5):
""" Return percentage below threshold while ignoring values with a -1 """
dist = dist[dist != -1]
if len(dist) > 0:
return 1.0 * (dist < thr).sum().item() / len(dist)
else:
return -1
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: bearpaw/pytorch-pose
Commit Name: 7ce6642f777e9da6249bd5b05330d57fa09ea37a
Time: 2019-01-07
Author: platero.yang@gmail.com
File Name: pose/utils/evaluation.py
Class Name:
Method Name: dist_acc
Project Name: pytorch/fairseq
Commit Name: 88daeb748b31ad27de6c34630968e0fc191e4326
Time: 2020-04-14
Author: myleott@fb.com
File Name: fairseq/data/strip_token_dataset.py
Class Name: StripTokenDataset
Method Name: __getitem__