class_docstr: Base class for stopping rules.
  
  A convergence criterion determines when an optimization has converged given
  its history of losses, gradients, and parameter values. Each criterion is
  responsible for propagating from step to step whatever state it needs to
  represent the relevant aspects of that history (for example, a moving average
  of previous loss values or gradients). In particular, subclasses must
  implement:
  
  - `_bootstrap(loss, grads, parameters)`: takes the
    initial loss, gradients, and values of parameters, and returns a (structure
    of) `Tensor`(s) representing the initial values of any auxiliary quantities
    tracked by the convergence criterion.
  - `_one_step(step, loss, grads, window_size, auxiliary_state)`: At
    integer `step >= 1`,
    takes the current loss, gradients, and values of parameters, along with
    any auxiliary state carried over from the previous step, and returns
    `(has_converged, updated_auxiliary_state)`, where `has_converged` is a
    boolean `Tensor`, and `updated_auxiliary_state` is a (structure of)
    Tensor(s) matching `auxiliary_state`, containing whatever information must
    be propagated to the next timestep.
docstr: Constructs the `ConvergenceCriterion`.
  
  This is a private method for subclass use.
  
  Args:
    min_num_steps: optional int `Tensor` minimum number of steps before
      stopping. If set, subclass return values of `has_converged=True` will be
      ignored until `step >= min_num_steps`.
      Default value: `None`.
    name: optional Python `str` name prefixed to ops created by this class.
docstr_tok: ["Constructs","the","`","ConvergenceCriterion","`",".","This","is","a","private","method","for","subclass","use",".","Args",":","min_num_steps",":","optional","int","`","Tensor","`","minimum","number","of","steps","before","stopping",".","If","set",",","subclass","return","values","of","`","has_converged=True","`","will","be","ignored","until","`","step",">","=","min_num_steps","`",".","Default","value",":","`","None","`",".","name",":","optional","Python","`","str","`","name","prefixed","to","ops","created","by","this","class","."]
code: def __init__(self, min_num_steps=None, name=None):
      """Constructs the `ConvergenceCriterion`.
  
      This is a private method for subclass use.
  
      Args:
        min_num_steps: optional int `Tensor` minimum number of steps before
          stopping. If set, subclass return values of `has_converged=True` will be
          ignored until `step >= min_num_steps`.
          Default value: `None`.
        name: optional Python `str` name prefixed to ops created by this class.
      """
      self._min_num_steps = tf.convert_to_tensor(
          min_num_steps, dtype=tf.int32
      )
      self._name = name
  
file_path: probability/tensorflow_probability/python/optimizer/convergence_criteria/convergence_criterion.py
imports: import tensorflow.compat.v2
label_desc: Use image node_id 1 to create a new ConvergenceCriterion object from inherited base classes: object with example: obj = ConvergenceCriterion(min_num_steps, name)