def __init__(self, x=None, y=None, input_fn=None, batch_size=None, eval_steps=None, every_n_steps=100, metrics=None, early_stopping_rounds=None, early_stopping_metric='loss', early_stopping_metric_minimize=True, name=None):
    'Initializes a ValidationMonitor.\n\n    Args:\n      x: See `BaseEstimator.evaluate`.\n      y: See `BaseEstimator.evaluate`.\n      input_fn: See `BaseEstimator.evaluate`.\n      batch_size: See `BaseEstimator.evaluate`.\n      eval_steps: See `BaseEstimator.evaluate`.\n      every_n_steps: Check for new checkpoints to evaluate every N steps. If a\n          new checkpoint is found, it is evaluated. See `EveryN`.\n      metrics: See `BaseEstimator.evaluate`.\n      early_stopping_rounds: `int`. If the metric indicated by\n          `early_stopping_metric` does not change according to\n          `early_stopping_metric_minimize` for this many steps, then training\n          will be stopped.\n      early_stopping_metric: `string`, name of the metric to check for early\n          stopping.\n      early_stopping_metric_minimize: `bool`, True if `early_stopping_metric` is\n          expected to decrease (thus early stopping occurs when this metric\n          stops decreasing), False if `early_stopping_metric` is expected to\n          increase. Typically, `early_stopping_metric_minimize` is True for\n          loss metrics like mean squared error, and False for performance\n          metrics like accuracy.\n      name: See `BaseEstimator.evaluate`.\n\n    Raises:\n      ValueError: If both x and input_fn are provided.\n    '
    super(ValidationMonitor, self).__init__(every_n_steps=every_n_steps, first_n_steps=(- 1))
    if ((x is None) and (input_fn is None)):
        raise ValueError('Either x or input_fn should be provided.')
    self.x = x
    self.y = y
    self.input_fn = input_fn
    self.batch_size = batch_size
    self.eval_steps = eval_steps
    self.metrics = metrics
    self.early_stopping_rounds = early_stopping_rounds
    self.early_stopping_metric = early_stopping_metric
    self.early_stopping_metric_minimize = early_stopping_metric_minimize
    self.name = name
    self._best_value_step = None
    self._best_value = None
    self._early_stopped = False
    self._latest_path = None
    self._latest_path_step = None
Initializes a ValidationMonitor.

Args:
  x: See `BaseEstimator.evaluate`.
  y: See `BaseEstimator.evaluate`.
  input_fn: See `BaseEstimator.evaluate`.
  batch_size: See `BaseEstimator.evaluate`.
  eval_steps: See `BaseEstimator.evaluate`.
  every_n_steps: Check for new checkpoints to evaluate every N steps. If a
      new checkpoint is found, it is evaluated. See `EveryN`.
  metrics: See `BaseEstimator.evaluate`.
  early_stopping_rounds: `int`. If the metric indicated by
      `early_stopping_metric` does not change according to
      `early_stopping_metric_minimize` for this many steps, then training
      will be stopped.
  early_stopping_metric: `string`, name of the metric to check for early
      stopping.
  early_stopping_metric_minimize: `bool`, True if `early_stopping_metric` is
      expected to decrease (thus early stopping occurs when this metric
      stops decreasing), False if `early_stopping_metric` is expected to
      increase. Typically, `early_stopping_metric_minimize` is True for
      loss metrics like mean squared error, and False for performance
      metrics like accuracy.
  name: See `BaseEstimator.evaluate`.

Raises:
  ValueError: If both x and input_fn are provided.
def __init__(self, x=None, y=None, input_fn=None, batch_size=None, eval_steps=None, every_n_steps=100, metrics=None, early_stopping_rounds=None, early_stopping_metric='loss', early_stopping_metric_minimize=True, name=None):
    'Initializes a ValidationMonitor.\n\n    Args:\n      x: See `BaseEstimator.evaluate`.\n      y: See `BaseEstimator.evaluate`.\n      input_fn: See `BaseEstimator.evaluate`.\n      batch_size: See `BaseEstimator.evaluate`.\n      eval_steps: See `BaseEstimator.evaluate`.\n      every_n_steps: Check for new checkpoints to evaluate every N steps. If a\n          new checkpoint is found, it is evaluated. See `EveryN`.\n      metrics: See `BaseEstimator.evaluate`.\n      early_stopping_rounds: `int`. If the metric indicated by\n          `early_stopping_metric` does not change according to\n          `early_stopping_metric_minimize` for this many steps, then training\n          will be stopped.\n      early_stopping_metric: `string`, name of the metric to check for early\n          stopping.\n      early_stopping_metric_minimize: `bool`, True if `early_stopping_metric` is\n          expected to decrease (thus early stopping occurs when this metric\n          stops decreasing), False if `early_stopping_metric` is expected to\n          increase. Typically, `early_stopping_metric_minimize` is True for\n          loss metrics like mean squared error, and False for performance\n          metrics like accuracy.\n      name: See `BaseEstimator.evaluate`.\n\n    Raises:\n      ValueError: If both x and input_fn are provided.\n    '
    super(ValidationMonitor, self).__init__(every_n_steps=every_n_steps, first_n_steps=(- 1))
    if ((x is None) and (input_fn is None)):
        raise ValueError('Either x or input_fn should be provided.')
    self.x = x
    self.y = y
    self.input_fn = input_fn
    self.batch_size = batch_size
    self.eval_steps = eval_steps
    self.metrics = metrics
    self.early_stopping_rounds = early_stopping_rounds
    self.early_stopping_metric = early_stopping_metric
    self.early_stopping_metric_minimize = early_stopping_metric_minimize
    self.name = name
    self._best_value_step = None
    self._best_value = None
    self._early_stopped = False
    self._latest_path = None
    self._latest_path_step = None