c109b0066d2a0292ac6040154898cda7b595d20a,recognition/partial_fc/pytorch/partial_classifier.py,DistSampleClassifier,sample,#DistSampleClassifier#,53
Before Change
torch.randperm(self.num_local, out=self.perm)
start = self.num_local - self.num_sample
index = torch.cat((positive, self.perm[start:]))
index = torch.unique(index, sorted=False)
start = index.size()[0] - self.num_sample
index = index[start:]
else:
index = positive
index = torch.sort(index)[0].long()
self.index = index
total_label[P] = torch.searchsorted(index, total_label[P])
self.sub_weight = Parameter(self.weight[index])
After Change
if self.num_sample - positive.size(0) >= 0:
perm = torch.rand(self.num_local,device=cfg.local_rank)
perm[positive] = 2.0
index = torch.topk(perm,k=self.num_sample)[1]
index = index.sort()[0]
else:
index = positive
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: deepinsight/insightface
Commit Name: c109b0066d2a0292ac6040154898cda7b595d20a
Time: 2020-11-10
Author: 43001198+xiaoyang-coder@users.noreply.github.com
File Name: recognition/partial_fc/pytorch/partial_classifier.py
Class Name: DistSampleClassifier
Method Name: sample
Project Name: mariogeiger/se3cnn
Commit Name: 3d416c2af588e4cf45962a9e8529a5b4fe042a10
Time: 2019-10-07
Author: lapchevsky.k@gmail.com
File Name: se3cnn/util/dataset/crystals.py
Class Name: CrystalCIF
Method Name: __getitem__
Project Name: PIQuIL/QuCumber
Commit Name: 51321f39fcc1698c011d2f0351474cdec1707a47
Time: 2019-12-20
Author: emerali@users.noreply.github.com
File Name: qucumber/utils/training_statistics.py
Class Name:
Method Name: NLL