class_docstr: A class representing routines called reactively at specific phases during trained.
  
  These can be used to log or visualize the training progress using any of the metric scores developed before.
  The values are stored at the end of each training epoch. The following metric scores are currently available:
  
      * :class:`~gensim.models.callbacks.CoherenceMetric`
      * :class:`~gensim.models.callbacks.PerplexityMetric`
      * :class:`~gensim.models.callbacks.DiffMetric`
      * :class:`~gensim.models.callbacks.ConvergenceMetric`
class_docstr_tok: ["A","class","representing","routines","called","reactively","at","specific","phases","during","trained",".","These","can","be","used","to","log","or","visualize","the","training","progress","using","any","of","the","metric","scores","developed","before",".","The","values","are","stored","at","the","end","of","each","training","epoch",".","The","following","metric","scores","are","currently","available",":","*",":","class",":","`","~gensim.models.callbacks.CoherenceMetric","`","*",":","class",":","`","~gensim.models.callbacks.PerplexityMetric","`","*",":","class",":","`","~gensim.models.callbacks.DiffMetric","`","*",":","class",":","`","~gensim.models.callbacks.ConvergenceMetric","`"]
docstr: Save the model instance and initialize any required variables which would be updated throughout training.
  
  Parameters
  ----------
  model : :class:`~gensim.models.basemodel.BaseTopicModel`
      The model for which the training will be reported (logged or visualized) by the callback.
docstr_tok: ["Save","the","model","instance","and","initialize","any","required","variables","which","would","be","updated","throughout","training",".","Parameters","--","--","--","--","--","model",":",":","class",":","`","~gensim.models.basemodel.BaseTopicModel","`","The","model","for","which","the","training","will","be","reported","(","logged","or","visualized",")","by","the","callback","."]
code: def set_model(self, model):
      """Save the model instance and initialize any required variables which would be updated throughout training.
  
      Parameters
      ----------
      model : :class:`~gensim.models.basemodel.BaseTopicModel`
          The model for which the training will be reported (logged or visualized) by the callback.
  
      """
      self.model = model
      self.previous = None
      # check for any metric which need model state from previous epoch
      if any(
          isinstance(metric, (DiffMetric, ConvergenceMetric))
          for metric in self.metrics
      ):
          self.previous = copy.deepcopy(model)
          # store diff diagonals of previous epochs
          self.diff_mat = Queue()
      if any(metric.logger == "visdom" for metric in self.metrics):
          if not VISDOM_INSTALLED:
              raise ImportError(
                  "Please install Visdom for visualization"
              )
          self.viz = Visdom()
          # store initial plot windows of every metric (same window will be updated with increasing epochs)
          self.windows = []
      if any(metric.logger == "shell" for metric in self.metrics):
          # set logger for current topic model
          self.log_type = logging.getLogger("gensim.models.ldamodel")
  
imports: import gensim
  import logging
  import copy
  import sys
  import numpy
label_desc: Use image node_id 2 for calling the Callback obj's underlying member method code with example usage: obj.set_model(model) without return types