Skip to main content

LibSPN

LibSPN is a library for learning and inference with Sum-Product Networks. LibSPN is integrated with TensorFlow.

What are SPNs?

Sum-Product Networks (SPNs) are a probabilistic deep architecture with solid theoretical foundations, which demonstrated state-of-the-art performance in several domains. Yet, surprisingly, there are no mature, general-purpose SPN implementations that would serve as a platform for the community of machine learning researchers centered around SPNs. LibSPN is a new general-purpose Python library, which aims to become such a platform. The library is designed to make it straightforward and effortless to apply various SPN architectures to large-scale datasets and problems. The library achieves scalability and efficiency, thanks to a tight coupling with TensorFlow, a framework already used by a large community of researchers and developers in multiple domains.

Why LibSPN?

Several reasons:

  • LibSPN is a general-purpose library with a generic interface and tools for generating SPN structure, making it easy to apply SPNs to any domain/problem
  • LibSPN offers a simple Python interface for building or generating networks, learning, and inference, facilitating prototyping (e.g. in Jupyter) and enabling simple integration of SPNs with other software
  • LibSPN is integrated with TensorFlow, making it possible to combine SPNs with other deep learning methods
  • LibSPN uses concepts that should sound familiar to TensorFlow users (e.g. tensors, variables, feeding, queues, batching, TensorBoard etc.)
  • LibSPN leverages the power of TensorFlow to efficiently perform parallel computations on (multiple) GPU devices
  • LibSPN is extendable, making it easy to add custom operations and graph nodes

Installation

Prerequisites

LibSPN requires installing tensorflow and tensorflow-probability first. The table below shows which version of each you'd need if you want to be specific:

tensorflow tensorflow-probability
1.14 0.7.0
1.13 0.6.0
1.12 0.5.0
1.11 0.4.0

First, install tensorflow or tensorflow-gpu:

pip install tensorflow-gpu

Then, install tensorflow-probability:

pip install tensorflow-probability

LibSPN

LibSPN is also available on pypi:

pip install libspn

Features of LibSPN

  • Simple interface for manual creation of custom network architectures

    • Automatic SPN validity checking and scope calculation
    • Adding explicit latent variables to sums/mixtures
    • Weight sharing
  • Integration with TensorFlow

    • SPN graph is converted to TensorFlow graph realizing specific algorithms/computations
    • Inputs to the network come from TensorFlow feeds or any TensorFlow tensors
  • SPN structure generation and learning

    • Dense random SPN generator
    • Simple naive Bayes mixture model generator
  • Loading and saving of structure and weights of learned models

  • Simple interface for random data generation, data loading and batching

    • Random data sampling from Gaussian Mixtures
    • Using TensorFlow queues for data loading, shuffling and batching
  • Built-in visualizations

    • SPN graph structure visualization
    • Data/distribution visualizations
  • SPN Inference

    • SPN/MPN value calculation
    • Gradient calculation
    • Inferring MPE state

Papers using LibSPN

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

libspn-0.1.2.tar.gz (12.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

libspn-0.1.2-py3-none-any.whl (166.5 kB view details)

Uploaded Python 3

File details

Details for the file libspn-0.1.2.tar.gz.

File metadata

  • Download URL: libspn-0.1.2.tar.gz
  • Upload date:
  • Size: 12.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.5.2

File hashes

Hashes for libspn-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7d1998f2dd780d2cb383e2c3052f52fdf923db92fa42f37158c7550ecdae0302
MD5 28933bf4566fe4df80d88d97bd854893
BLAKE2b-256 f94ad09b9bcc83d8face0330b767cebd8eb2fa4a52a40c50ea08de7f53357c86

See more details on using hashes here.

File details

Details for the file libspn-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: libspn-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 166.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.5.2

File hashes

Hashes for libspn-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b739e054a905f83ca84d8ad48bc10611b26682530c3e3bd262bb311d8acae799
MD5 b65b7d7056dce9d9fbd9818518161b6f
BLAKE2b-256 c23f2dffe0503f6900b2c9bd3772ffdf16629a1504d8baa0889d6f5f24866768

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page