Extends Networkx Directed Graph to support Bayesian networks and implements belief propagation to compute marginal probabilities.