7b34113cc3b5529a127bd02667de9de0b5b75df9,models/dist_model.py,,score_jnd_dataset,#,301
Before Change
gts = []
for data in tqdm(data_loader.load_data(), desc=name):
ds+=func(data["p0"],data["p1"]).tolist()
gts+=data["same"].cpu().numpy().flatten().tolist()
sames = np.array(gts)
ds = np.array(ds)
sorted_inds = np.argsort(ds)
ds_sorted = ds[sorted_inds]
sames_sorted = sames[sorted_inds]
TPs = np.cumsum(sames_sorted)
FPs = np.cumsum(1-sames_sorted)
FNs = np.sum(sames_sorted)-TPs
precs = TPs/(TPs+FPs)
recs = TPs/(TPs+FNs)
score = util.voc_ap(recs,precs)
return(score, dict(ds=ds,sames=sames))
After Change
gts = []
for data in tqdm(data_loader.load_data(), desc=name):
ds+=func(data["p0"],data["p1"]).data.cpu().numpy().tolist()
gts+=data["same"].cpu().numpy().flatten().tolist()
sames = np.array(gts)
ds = np.array(ds)
sorted_inds = np.argsort(ds)
ds_sorted = ds[sorted_inds]
sames_sorted = sames[sorted_inds]
TPs = np.cumsum(sames_sorted)
FPs = np.cumsum(1-sames_sorted)
FNs = np.sum(sames_sorted)-TPs
precs = TPs/(TPs+FPs)
recs = TPs/(TPs+FNs)
score = util.voc_ap(recs,precs)
return(score, dict(ds=ds,sames=sames))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 2
Instances
Project Name: richzhang/PerceptualSimilarity
Commit Name: 7b34113cc3b5529a127bd02667de9de0b5b75df9
Time: 2019-07-26
Author: rich.zhang@eecs.berkeley.edu
File Name: models/dist_model.py
Class Name:
Method Name: score_jnd_dataset
Project Name: rodluger/starry
Commit Name: 938d743069a6fdcbb9818f334ab6b7e282d1340a
Time: 2020-09-12
Author: rodluger@gmail.com
File Name: starry/_core/ops/polybasis.py
Class Name: pTGradientOp
Method Name: perform
Project Name: Bihaqo/t3f
Commit Name: fb43d1f4a64b77f8b64134460b0c77cb5f79e185
Time: 2018-10-31
Author: sasha.v.novikov@gmail.com
File Name: t3f/autodiff.py
Class Name:
Method Name: hessian_vector_product