e583ae1925021107a0672e5cd4f586aef3e50452,pytorch/seg_metrics.py,PixelAccuracyMetric,update,#PixelAccuracyMetric#Any#Any#,47

Before Change


        for label, pred in zip(labels, preds):
            pred = pred.max(dim=self.axis)[1]
            label = label.max(dim=self.axis)[1]
            self.sum_metric += pred.eq(label).sum()
            self.num_inst += pred.numel()

    def reset(self):
        

After Change


        check_label_shapes(labels, preds)
        if self.on_cpu:
            if self.sparse_label:
                label_imask = labels.cpu().numpy().astype(np.int32)
            else:
                label_imask = torch.argmax(labels, dim=self.axis).cpu().numpy().astype(np.int32)
            pred_imask = torch.argmax(preds, dim=self.axis).cpu().numpy().astype(np.int32)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: osmr/imgclsmob
Commit Name: e583ae1925021107a0672e5cd4f586aef3e50452
Time: 2019-03-27
Author: osemery@gmail.com
File Name: pytorch/seg_metrics.py
Class Name: PixelAccuracyMetric
Method Name: update


Project Name: OpenNMT/OpenNMT-py
Commit Name: 0c97e1acc3ef43c6ba18c5db25b5d6c5873866b9
Time: 2018-04-29
Author: srush@seas.harvard.edu
File Name: onmt/Loss.py
Class Name: LossComputeBase
Method Name: _stats


Project Name: carpedm20/ENAS-pytorch
Commit Name: 808b8fb7a5a17e2b47d13103ed3a78dfdcd2fe3f
Time: 2018-02-20
Author: carpedm20@gmail.com
File Name: trainer.py
Class Name: Trainer
Method Name: train_controller