ba256835a4f33d9139a70b6440c3223123132bc8,torchnet/meter/confusionmeter.py,ConfusionMeter,add,#ConfusionMeter#,42
Before Change
assert (target.sum(1) == 1).all(), \
"multi-label setting is not supported"
pred = output.argmax(1)
for i,n in enumerate(pred):
pos = onehot and target[i].argmax(0) or int(target[i])
self.conf[pos][n] += 1
After Change
// hack for bincounting 2 arrays together
x = predicted + self.k * target
bincount_2d = np.bincount(x.astype(np.int32),
minlength=self.k ** 2)
assert bincount_2d.size == self.k ** 2
conf = bincount_2d.reshape((self.k, self.k))
self.conf += conf
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances Project Name: pytorch/tnt
Commit Name: ba256835a4f33d9139a70b6440c3223123132bc8
Time: 2017-08-24
Author: swetha.tanamala@gmail.com
File Name: torchnet/meter/confusionmeter.py
Class Name: ConfusionMeter
Method Name: add
Project Name: IBM/AIF360
Commit Name: e3a249cd2de8b2518470021db0f579e26cafbfba
Time: 2020-02-19
Author: hoffman.sc@gmail.com
File Name: aif360/sklearn/inprocessing/adversarial_debiasing.py
Class Name: AdversarialDebiasing
Method Name: predict
Project Name: yahoo/TensorFlowOnSpark
Commit Name: 981e4266d4ea816b08a762193bd52f40cd1a3242
Time: 2019-08-07
Author: leewyang@verizonmedia.com
File Name: examples/mnist/keras/mnist_inference.py
Class Name:
Method Name: inference