DeeProb-kit: a Python Library for Deep Probabilistic Modelling

Lorenzo Loconte, Gennaro GalaarXiv 2022

Abstract

DeeProb-kit is a unified library written in Python consisting of a collection of deep probabilistic models (DPMs) that are tractable and exact representations for the modelled probability distributions. The availability of a representative selection of DPMs in a single library makes it possible to combine them in a straightforward manner, a common practice in deep learning research nowadays. In addition, it includes efficiently implemented learning techniques, inference routines, statistical algorithms, and provides high-quality fully-documented APIs. The development of DeeProb-kit will help the community to accelerate research on DPMs as well as to standardise their evaluation and better understand how they are related based on their expressivity.

Introduction

In the field of machine learning, modeling complex probability distributions is a fundamental task. Deep Probabilistic Models (DPMs) are essential tools for this, yet they have historically faced two significant hurdles: tractability and fragmentation. While popular models like Variational Auto-Encoders (VAEs) excel at data generation, calculating the exact probability of a specific observation is often mathematically intractable. Conversely, models like Normalizing Flows (NFs) and Probabilistic Circuits (PCs) offer exact inference but have suffered from fragmented, incompatible implementations across legacy frameworks like TensorFlow 1, Theano, or custom C++ codebases.

The DeeProb-kit Framework

DeeProb-kit addresses these issues by unifying diverse DPMs under a single PyTorch-based roof. This standardization enables seamless GPU acceleration and simplifies the hybridization of models—for instance, allowing a researcher to define a Normalizing Flow that uses a Gaussian RAT-SPN as its base distribution without extensive custom engineering.

A taxonomy of supported models in DeeProb-kit, including various Probabilistic Circuits and Normalizing Flows.

The library's architecture prioritizes models capable of exact and efficient inference. By utilizing abstract base classes, it remains highly extensible, allowing researchers to integrate new model types while maintaining full compatibility with existing inference and learning routines. Beyond model definitions, the library includes built-in implementations for learning techniques, such as Chow-Liu Trees, and various statistical algorithms.

Performance and Benchmarking

To evaluate the library's efficiency, the authors benchmarked DeeProb-kit against SPFlow, the current industry standard, across three binary datasets: msweb (294 variables), bmnist (784 variables), and ad (1,556 variables). The results demonstrate significant improvements in both learning and inference speeds, largely due to better hardware utilization and modern framework optimizations.

Comparison of learning and inference times between SPFlow and DeeProb-kit across standard datasets.

Key findings from the benchmarks include:

  • Learning Speed: On the bmnist dataset, learning a Chow-Liu Tree was reduced from 160.27 seconds in SPFlow to just 0.28 seconds in DeeProb-kit.
  • Inference Efficiency: Marginal queries ($Q_{MAR}$) on bmnist were approximately 25x faster in DeeProb-kit (10.53s vs 272.04s).
  • Hardware Utilization: The library effectively leverages modern hardware, using PyTorch for dense, tensor-heavy models and multi-core CPU parallelization with SIMD features for sparse models, ensuring efficiency regardless of the model's structural shape.

Conclusion

DeeProb-kit represents a major step toward standardizing DPM research. By reducing the engineering overhead required to combine and evaluate these models, the library serves as a catalyst for discovering more expressive probabilistic architectures. Future work will focus on expanding the variety of supported Normalizing Flows and improving scalability to handle even larger, higher-dimensional datasets.

Summary updated

BibTeX
@misc{loconte2022deeprob,
  author = {Lorenzo Loconte and Gennaro Gala},
  title = {{DeeProb-kit: a Python Library for Deep Probabilistic Modelling}},
  year = {2022},
  eprint = {2212.04403},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2212.04403},
}
Figure