ba256835a4f33d9139a70b6440c3223123132bc8,torchnet/meter/confusionmeter.py,ConfusionMeter,add,#ConfusionMeter#Any#Any#,42
Before Change
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
def value(self):
if self.normalized:
After Change
if np.ndim(predicted) != 1:
assert predicted.shape[1] == self.k, \
"number of predictions does not match size of confusion matrix"
predicted = np.argmax(predicted, 1)
else:
assert (predicted.max() < self.k) and (predicted.min() >= 0), \
"predicted values are not between 1 and k"
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: pythonstock/stock
Commit Name: 04d0a9bbfc085d244ee5abed1e4591202a8bd4cb
Time: 2017-10-26
Author: yhy
File Name: web/minstServingHandler.py
Class Name:
Method Name: do_inference
Project Name: wenwei202/iss-rnns
Commit Name: 00d47eb3923d8722f75d56ba15139ad6821e2f50
Time: 2016-08-29
Author: seominjoon@gmail.com
File Name: basic/evaluator.py
Class Name: AccuracyEvaluator2
Method Name: compare