SPFlow  by SPFlow

Python library for Sum-Product Networks (SPNs)

Created 7 years ago
304 stars

Top 88.0% on SourcePulse

GitHubView on GitHub
Project Summary

SPFlow is a Python library for building, learning, and performing inference on Sum-Product Networks (SPNs), a class of deep probabilistic models that allow for tractable inference. It is designed for researchers and practitioners in machine learning and probabilistic modeling who need efficient tools for complex probability distributions.

How It Works

SPFlow represents SPNs as a hierarchical structure of Sum and Product nodes, with various leaf node types (e.g., Categorical, Gaussian, PiecewiseLinear). It supports both a domain-specific language (DSL) and programmatic construction of SPNs. The library offers efficient implementations for inference tasks like marginalization, computing conditionals, and approximate Most Probable Explanation (MPE), as well as sampling and visualization utilities. Its functional-oriented API framework is designed for extensibility, allowing users to integrate custom inference and learning routines.

Quick Start & Requirements

  • Install: pip3 install spflow
  • Dependencies: TensorFlow (GPU support available via spn.gpu.TensorFlow), NumPy.
  • Arch Linux: yay -S python-spflow (includes a patch for TensorFlow 2 compatibility).
  • Documentation: https://github.com/SPFlow/SPFlow

Highlighted Details

  • Supports learning SPNs from data using various algorithms (e.g., learn_parametric, learn_classifier, learn_mspn, learn_cnet).
  • Enables GPU acceleration for inference and parameter optimization via TensorFlow integration.
  • Allows for custom leaf node types and inference functions, promoting extensibility.
  • Includes utilities for SPN structure validation and statistical analysis.

Maintenance & Community

The project lists several academic institutions and researchers as authors and contributors, indicating active development and research backing. Links to community resources are not explicitly provided in the README.

Licensing & Compatibility

  • License: Apache License, Version 2.0.
  • Compatibility: Permissive license suitable for commercial use and integration with closed-source projects.

Limitations & Caveats

The README does not explicitly mention limitations such as unsupported platforms, known bugs, or performance bottlenecks. The project's reliance on specific TensorFlow versions might require careful dependency management.

Health Check
Last Commit

1 week ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
2 stars in the last 30 days

Explore Similar Projects

Starred by Elvis Saravia Elvis Saravia(Founder of DAIR.AI), Roy Frostig Roy Frostig(Coauthor of JAX; Research Scientist at Google DeepMind), and
8 more.

numpyro by pyro-ppl

0.1%
3k
Probabilistic programming library using JAX for GPU/TPU/CPU
Created 6 years ago
Updated 1 week ago
Feedback? Help us improve.