class_docstr: Abstract base class for inference. All inference algorithms in
  Edward inherit from `Inference`, sharing common methods and
  properties via a class hierarchy.
  
  Specific algorithms typically inherit from other subclasses of
  `Inference` rather than `Inference` directly. For example, one
  might inherit from the abstract classes `MonteCarlo` or
  `VariationalInference`.
  
  To build an algorithm inheriting from `Inference`, one must at the
  minimum implement `initialize` and `update`: the former builds
  the computational graph for the algorithm; the latter runs the
  computational graph for the algorithm.
  
  To reset inference (e.g., internal variable counters incremented
  over training), fetch inference's reset ops from session with
  `sess.run(inference.reset)`.
  
  #### Examples
  
  ```python
  # Set up probability model.
  mu = Normal(loc=0.0, scale=1.0)
  x = Normal(loc=mu, scale=1.0, sample_shape=50)
  
  # Set up posterior approximation.
  qmu_loc = tf.Variable(tf.random_normal([]))
  qmu_scale = tf.nn.softplus(tf.Variable(tf.random_normal([])))
  qmu = Normal(loc=qmu_loc, scale=qmu_scale)
  
  inference = ed.Inference({mu: qmu}, data={x: tf.zeros(50)})
  ```
class_docstr_tok: ["Abstract","base","class","for","inference",".","All","inference","algorithms","in","Edward","inherit","from","`","Inference","`",",","sharing","common","methods","and","properties","via","a","class","hierarchy",".","Specific","algorithms","typically","inherit","from","other","subclasses","of","`","Inference","`","rather","than","`","Inference","`","directly",".","For","example",",","one","might","inherit","from","the","abstract","classes","`","MonteCarlo","`","or","`","VariationalInference","`",".","To","build","an","algorithm","inheriting","from","`","Inference","`",",","one","must","at","the","minimum","implement","`","initialize","`","and","`","update","`",":","the","former","builds","the","computational","graph","for","the","algorithm",";","the","latter","runs","the","computational","graph","for","the","algorithm",".","To","reset","inference","(","e.g.",",","internal","variable","counters","incremented","over","training",")",",","fetch","inference","'s","reset","ops","from","session","with","`","sess.run","(","inference.reset",")","`",".","#","#","#","#","Examples","``","`","python","#","Set","up","probability","model",".","mu","=","Normal","(","loc=0.0",",","scale=1.0",")","x","=","Normal","(","loc=mu",",","scale=1.0",",","sample_shape=50",")","#","Set","up","posterior","approximation",".","qmu_loc","=","tf.Variable","(","tf.random_normal","(","[","]",")",")","qmu_scale","=","tf.nn.softplus","(","tf.Variable","(","tf.random_normal","(","[","]",")",")",")","qmu","=","Normal","(","loc=qmu_loc",",","scale=qmu_scale",")","inference","=","ed.Inference","(","{","mu",":","qmu","}",",","data=","{","x",":","tf.zeros","(","50",")","}",")","``","`"]
docstr: Function to call after convergence.
      
docstr_tok: ["Function","to","call","after","convergence","."]
code: def finalize(self):
      """Function to call after convergence."""
      if self.logging:
          self.train_writer.close()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import numpy
  import six
  import tensorflow
  import os
  from datetime import datetime
  from edward.models import RandomVariable
  from edward.util import check_data, check_latent_vars, get_session, get_variables, Progbar, transform
  from tensorflow.contrib.distributions import bijectors
label_desc: Use image node_id 6 for calling the Inference obj's underlying member method code with example usage: obj.finalize() without return types