class_docstr: Convergence stopping check
  
  Parameters
  ----------
  every: int
      check frequency
  tolerance: float
      if diff norm < tolerance: break
  diff: str
      difference type one of {'absolute', 'relative'}
  ord: {non-zero int, inf, -inf, 'fro', 'nuc'}, optional
      see more info in :func:`numpy.linalg.norm`
  
  Examples
  --------
  >>> with model:
  ...     approx = pm.fit(
  ...         n=10000, callbacks=[
  ...             CheckParametersConvergence(
  ...                 every=50, diff='absolute',
  ...                 tolerance=1e-4)
  ...         ]
  ...     )
class_docstr_tok: ["Convergence","stopping","check","Parameters","--","--","--","--","--","every",":","int","check","frequency","tolerance",":","float","if","diff","norm","<","tolerance",":","break","diff",":","str","difference","type","one","of","{","'absolute","'",",","'relative","'","}","ord",":","{","non-zero","int",",","inf",",","-inf",",","'fro","'",",","'nuc","'","}",",","optional","see","more","info","in",":","func",":","`","numpy.linalg.norm","`","Examples","--","--","--","--",">",">",">","with","model",":","...","approx","=","pm.fit","(","...","n=10000",",","callbacks=","[","...","CheckParametersConvergence","(","...","every=50",",","diff='absolute","'",",","...","tolerance=1e-4",")","...","]","...",")"]
code: def __init__(
      self, every=100, tolerance=1e-3, diff="relative", ord=np.inf
  ):
      self._diff = _diff[diff]
      self.ord = ord
      self.every = every
      self.prev = None
      self.tolerance = tolerance
  
file_path: pymc/pymc/variational/callbacks.py
imports: import collections
  from typing import Callable, Dict
  import numpy
label_desc: Use image node_id 1 to create a new CheckParametersConvergence object from inherited base classes: Callback with example: obj = CheckParametersConvergence(every, tolerance, diff, ord)