1938a5af6d1ea3a2d8dccbb831f82990800fa3e1,allennlp/training/metrics/boolean_accuracy.py,BooleanAccuracy,__call__,#BooleanAccuracy#Any#Any#Any#,23

Before Change



        // The .prod() here is functioning as a logical and.
        correct = predictions.eq(gold_labels).prod(dim=1).float()
        count = torch.ones(gold_labels.size(0))
        self._correct_count += correct.sum()
        self._total_count += count.sum()

    def get_metric(self, reset: bool = False):

After Change



            // We want to skip predictions that are completely masked;
            // so we"ll keep predictions that aren"t.
            keep = mask.view(batch_size, -1).max(dim=1)[0].float()
        else:
            keep = torch.ones(batch_size).float()

        predictions = predictions.view(batch_size, -1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: allenai/allennlp
Commit Name: 1938a5af6d1ea3a2d8dccbb831f82990800fa3e1
Time: 2018-12-22
Author: joelgrus@gmail.com
File Name: allennlp/training/metrics/boolean_accuracy.py
Class Name: BooleanAccuracy
Method Name: __call__


Project Name: CellProfiler/CellProfiler
Commit Name: 3ec0343f716e91a590a28c985c9ca6d0a2202cb7
Time: 2016-10-31
Author: mcquin@users.noreply.github.com
File Name: cellprofiler/modules/watershed.py
Class Name: Watershed
Method Name: run


Project Name: bashtage/linearmodels
Commit Name: 65add949bbcd61e2b1c3b8dc33390ac15d19cd84
Time: 2021-02-22
Author: kevin.k.sheppard@gmail.com
File Name: linearmodels/shared/linalg.py
Class Name:
Method Name: has_constant