class_docstr: A Bayesian network object.
  
  A Bayesian network is a probability distribution where dependencies between
  variables are explicitly encoded in a graph structure and the lack of an
  edge represents a conditional independence. These graphs are directed and
  typically must be acyclic, but this implementation allows for the networks
  to be cyclic as long as there is no assumption of convergence during
  inference.
  
  Inference is doing using loopy belief propogation along a factor graph
  representation. This is sometimes called the `sum-product` algorithm.
  It will yield exact results if the graph has a tree-like structure.
  Otherwise, if the graph is acyclic, it is guaranteed to converge but not
  necessarily to optimal results. If the graph is cyclic, there is no
  guarantee on convergence, but it is thought that the longer the loop is the 
  more likely one will get good results.
  
  Structure learning can be done using a variety of methods. 
  
  
  Parameters
  ----------
  distributions: tuple or list or None
          A set of distribution objects. These do not need to be initialized,
          i.e. can be "Categorical()". Currently, they must be either Categorical
          or JointCategorical distributions. If provided, they must be consistent
          with the provided edges in that every conditional distribution must
          have at least one parent in the provided structure. Default is None.
  
  edges: tuple or list or None, optional
          A list or tuple of 2-tuples where the first element in the 2-tuple is 
          the parent distribution object and the second element is the child
          distribution object. If None, then no edges. Default is None.
  
  struture: tuple or list or None, optional
          A list or tuple of the parents for each distribution with a tuple
          containing no elements indicating a root node. For instance, 
          ((), (0,), (), (0, 2)) would represent a graph with four nodes, 
          where the second distribution has the first distribution as a parent 
          and the fourth distribution has the first and third distributions as 
          parents. Use this only when you want new distribution objects to be
          created and fit when using the `fit` method. Default is None.
  
  max_iter: int, optional
          The number of iterations to do in the inference step. Default is 10.
  
  tol: float, optional
          The threshold at which to stop during fitting when the improvement
          goes under. Default is 1e-6.
  
  inertia: float, [0, 1], optional
          Indicates the proportion of the update to apply to the parameters
          during fitting. When the inertia is 0.0, the update is applied in
          its entirety and the previous parameters are ignored. When the
          inertia is 1.0, the update is entirely ignored and the previous
          parameters are kept, equivalently to if the parameters were frozen.
  
  frozen: bool, optional
          Whether all the parameters associated with this distribution are frozen.
          If you want to freeze individual pameters, or individual values in those
          parameters, you must modify the `frozen` attribute of the tensor or
          parameter directly. Default is False.
  
  check_data: bool, optional
          Whether to check properties of the data and potentially recast it to
          torch.tensors. This does not prevent checking of parameters but can
          slightly speed up computation when you know that your inputs are valid.
          Setting this to False is also necessary for compiling. Default is True.
  
  verbose: bool, optional
          Whether to print the improvement and timings during training.
code: def _reset_cache(self):
      return
  
imports: import time
  import numpy
  import torch
  import itertools
  import networkx
  from ._utils import _cast_as_tensor
  from ._utils import _cast_as_parameter
  from ._utils import _update_parameter
  from ._utils import _check_parameter
  from ._utils import _reshape_weights
  from .distributions._distribution import Distribution
  from .distributions import Categorical
  from .distributions import JointCategorical
  from .distributions import ConditionalCategorical
  from .factor_graph import FactorGraph
label_desc: Use image node_id 3 for calling the BayesianNetwork obj's underlying member method code with example usage: obj._reset_cache() without return types