3fb9f4a6bcb887f459f8e229cc4af6d3cc2b3fd1,opennmt/evaluation.py,Evaluator,should_stop,#Evaluator#,161

Before Change


    if self._early_stopping is None:
      return False
    target_metric = self._early_stopping.metric
    scorers = {scorer.name:score for scorer in self._scorers}
    if target_metric in scorers:
      higher_is_better = scorers[target_metric].higher_is_better()
    else:
      // TODO: the condition below is not always true, find a way to set it
      // correctly for Keras metrics.

After Change


    higher_is_better = None
    // Look if target_metric is produced by a scorer as they define the scores order.
    for scorer in self._scorers:
      if target_metric in scorer.scores_name:
        higher_is_better = scorer.higher_is_better()
        break
    if higher_is_better is None:
      // TODO: the condition below is not always true, find a way to set it
      // correctly for Keras metrics.
      higher_is_better = target_metric != "loss"
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: OpenNMT/OpenNMT-tf
Commit Name: 3fb9f4a6bcb887f459f8e229cc4af6d3cc2b3fd1
Time: 2019-09-30
Author: guillaume.klein@systrangroup.com
File Name: opennmt/evaluation.py
Class Name: Evaluator
Method Name: should_stop


Project Name: BindsNET/bindsnet
Commit Name: b6240c06fb49020e2d51703a1fcfddba7e27297d
Time: 2019-06-21
Author: djsaunde@umass.edu
File Name: bindsnet/network/network.py
Class Name: Network
Method Name: run


Project Name: deepchem/deepchem
Commit Name: 86328d567ff862262e0da70d0ebc9d90b407e03a
Time: 2017-11-29
Author: peastman@stanford.edu
File Name: deepchem/models/tensorgraph/tensor_graph.py
Class Name: TensorGraph
Method Name: predict_on_generator