NBN's design philosophy is completely different from traditional Bayesian network libraries. In traditional implementations, conditional probability tables are static data structures, and the inference process involves a lot of discrete lookups and Python-level loops. In contrast, NBN treats each conditional probability distribution as a learnable neural network module.
Specifically, each node in NBN carries a learnable, batch-processing-supported, GPU-resident conditional distribution. This means:
- Conditional Probability Distribution as Neural Network: Whether it's a classification table for discrete variables, a mixture density network for continuous variables, or a complex Gaussian process, all can serve as the conditional probability mechanism for nodes
- Query as Tensor Operation: All inference queries are expressed as batch tensor operations, natively supporting PyTorch's automatic differentiation and GPU acceleration
- End-to-End Learnable: Both parameter learning and structure learning can be done via gradient descent, without the need for traditional MLE or EM algorithms
This architecture allows NBN to seamlessly integrate into modern deep learning workflows, enabling researchers to use the familiar PyTorch API to build, train, and infer complex probabilistic graphical models.