1180972540f54c36a7fcec47097a304c7033d20a,parlai/core/metrics.py,Metrics,_update_ranking_metrics,#Metrics#Any#Any#,396

Before Change


                self.flags["has_text_cands"] = True
                for k in self.eval_pr:
                    if cnts[k] > 0:
                        self.metrics["hits@" + str(k)] += 1
                self.metrics["hits@_cnt"] += 1

    def update(self, observation, labels):
        
        Update metrics based on an observation and true labels.

After Change


        // (other metrics such as p@k and r@k take
        // the value of cnt into account.)
        for k in self.eval_pr:
            self.add(f"hits@{k}", AverageMetric(cnts[k] > 0))

    def evaluate_response(self, observation: Message, labels: List[str]) -> None:
        
        Compute all required text-based metrics based on an observation and labels.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: facebookresearch/ParlAI
Commit Name: 1180972540f54c36a7fcec47097a304c7033d20a
Time: 2020-01-31
Author: roller@fb.com
File Name: parlai/core/metrics.py
Class Name: Metrics
Method Name: _update_ranking_metrics


Project Name: analysiscenter/batchflow
Commit Name: 53f15232ed13154bc5338dc002b43c3c62547ea7
Time: 2017-11-12
Author: rhudor@gmail.com
File Name: dataset/models/tf/vgg.py
Class Name: VGG
Method Name: body


Project Name: analysiscenter/batchflow
Commit Name: 02098c5c44893ce455aefcfc452aa00bd655987b
Time: 2017-11-15
Author: rhudor@gmail.com
File Name: dataset/models/tf/unet.py
Class Name: UNet
Method Name: body