class_docstr: Class for performing inference using Belief Propagation method.
  
  Creates a Junction Tree or Clique Tree (JunctionTree class) for the input
  probabilistic graphical model and performs calibration of the junction tree
  so formed using belief propagation.
  
  Parameters
  ----------
  model: BayesianNetwork, MarkovNetwork, FactorGraph, JunctionTree
      model for which inference is to performed
code: def __init__(self, model):
      super(BeliefPropagation, self).__init__(model)
  
      if not isinstance(model, JunctionTree):
          self.junction_tree = model.to_junction_tree()
      else:
          self.junction_tree = copy.deepcopy(model)
  
      self.clique_beliefs = {}
      self.sepset_beliefs = {}
  
imports: import copy
  import itertools
  import networkx
  import numpy
  from opt_einsum import contract
  from tqdm.auto import tqdm
  from pgmpy import config
  from pgmpy.factors import factor_product
  from pgmpy.factors.discrete import DiscreteFactor
  from pgmpy.inference import Inference
  from pgmpy.inference.EliminationOrder import MinFill, MinNeighbors, MinWeight, WeightedMinFill
  from pgmpy.models import BayesianNetwork, DynamicBayesianNetwork, JunctionTree, MarkovNetwork
  from pgmpy.utils import compat_fns
label_desc: Use image node_id 1 to create a new BeliefPropagation object from inherited base classes: Inference with example: obj = BeliefPropagation(model)