class_docstr: EarlyStopping class to keep NN from overfitting
      
code: def _init_is_better(self, mode, min_delta, percentage):
      if mode not in {"min", "max"}:
          raise ValueError("mode " + mode + " is unknown!")
      if not percentage:
          if mode == "min":
              self.is_better = lambda a, best: a < best - min_delta
          if mode == "max":
              self.is_better = lambda a, best: a > best + min_delta
      else:
          if mode == "min":
              self.is_better = lambda a, best: a < best - (
                  best * min_delta / 100
              )
          if mode == "max":
              self.is_better = lambda a, best: a > best + (
                  best * min_delta / 100
              )
  
file_path: nni/examples/trials/network_morphism/FashionMNIST/utils.py
imports: import numpy
  import torch
  import torch.nn
  import torch.nn.init
  import torchvision.transforms
label_desc: Use image node_id 3 for calling the EarlyStopping obj's underlying member method code with example usage: obj._init_is_better(mode, min_delta, percentage) without return types