class_docstr: Performs validation while training a KerasModel.
  
  This is a callback that can be passed to fit().  It periodically computes a
  set of metrics over a validation set, writes them to a file, and keeps track
  of the best score. In addition, it can save the best model parameters found
  so far to a directory on disk, updating them every time it finds a new best
  validation score.
  
  If Tensorboard logging is enabled on the KerasModel, the metrics are also
  logged to Tensorboard.  This only happens when validation coincides with a
  step on which the model writes to the log.  You should therefore make sure
  that this callback's reporting interval is an even fraction or multiple of
  the model's logging interval.
class_docstr_tok: ["Performs","validation","while","training","a","KerasModel",".","This","is","a","callback","that","can","be","passed","to","fit","(",")",".","It","periodically","computes","a","set","of","metrics","over","a","validation","set",",","writes","them","to","a","file",",","and","keeps","track","of","the","best","score",".","In","addition",",","it","can","save","the","best","model","parameters","found","so","far","to","a","directory","on","disk",",","updating","them","every","time","it","finds","a","new","best","validation","score",".","If","Tensorboard","logging","is","enabled","on","the","KerasModel",",","the","metrics","are","also","logged","to","Tensorboard",".","This","only","happens","when","validation","coincides","with","a","step","on","which","the","model","writes","to","the","log",".","You","should","therefore","make","sure","that","this","callback","'s","reporting","interval","is","an","even","fraction","or","multiple","of","the","model","'s","logging","interval","."]
docstr: Create a ValidationCallback.
  
  Parameters
  ----------
  dataset: dc.data.Dataset
      the validation set on which to compute the metrics
  interval: int
      the interval (in training steps) at which to perform validation
  metrics: list of dc.metrics.Metric
      metrics to compute on the validation set
  output_file: file
      to file to which results should be written
  save_dir: str
      if not None, the model parameters that produce the best validation score
      will be written to this directory
  save_metric: int
      the index of the metric to use when deciding whether to write a new set
      of parameters to disk
  save_on_minimum: bool
      if True, the best model is considered to be the one that minimizes the
      validation metric.  If False, the best model is considered to be the one
      that maximizes it.
  transformers: List[Transformer]
      List of `dc.trans.Transformer` objects. These transformations
      must have been applied to `dataset` previously. The dataset will
      be untransformed for metric evaluation.
docstr_tok: ["Create","a","ValidationCallback",".","Parameters","--","--","--","--","--","dataset",":","dc.data.Dataset","the","validation","set","on","which","to","compute","the","metrics","interval",":","int","the","interval","(","in","training","steps",")","at","which","to","perform","validation","metrics",":","list","of","dc.metrics.Metric","metrics","to","compute","on","the","validation","set","output_file",":","file","to","file","to","which","results","should","be","written","save_dir",":","str","if","not","None",",","the","model","parameters","that","produce","the","best","validation","score","will","be","written","to","this","directory","save_metric",":","int","the","index","of","the","metric","to","use","when","deciding","whether","to","write","a","new","set","of","parameters","to","disk","save_on_minimum",":","bool","if","True",",","the","best","model","is","considered","to","be","the","one","that","minimizes","the","validation","metric",".","If","False",",","the","best","model","is","considered","to","be","the","one","that","maximizes","it",".","transformers",":","List","[","Transformer","]","List","of","`","dc.trans.Transformer","`","objects",".","These","transformations","must","have","been","applied","to","`","dataset","`","previously",".","The","dataset","will","be","untransformed","for","metric","evaluation","."]
code: def __init__(
      self,
      dataset,
      interval,
      metrics,
      output_file=sys.stdout,
      save_dir=None,
      save_metric=0,
      save_on_minimum=True,
      transformers=[],
  ):
      """Create a ValidationCallback.
  
      Parameters
      ----------
      dataset: dc.data.Dataset
          the validation set on which to compute the metrics
      interval: int
          the interval (in training steps) at which to perform validation
      metrics: list of dc.metrics.Metric
          metrics to compute on the validation set
      output_file: file
          to file to which results should be written
      save_dir: str
          if not None, the model parameters that produce the best validation score
          will be written to this directory
      save_metric: int
          the index of the metric to use when deciding whether to write a new set
          of parameters to disk
      save_on_minimum: bool
          if True, the best model is considered to be the one that minimizes the
          validation metric.  If False, the best model is considered to be the one
          that maximizes it.
      transformers: List[Transformer]
          List of `dc.trans.Transformer` objects. These transformations
          must have been applied to `dataset` previously. The dataset will
          be untransformed for metric evaluation.
      """
      self.dataset = dataset
      self.interval = interval
      self.metrics = metrics
      self.output_file = output_file
      self.save_dir = save_dir
      self.save_metric = save_metric
      self.save_on_minimum = save_on_minimum
      self._best_score = None
      self.transformers = transformers
  
imports: import sys
label_desc: Use image node_id 1 to create a new ValidationCallback object from inherited base classes: object with example: obj = ValidationCallback(dataset, interval, metrics, output_file, save_dir, save_metric, save_on_minimum, transformers)