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
- Deep Convolutional Sum-Product Networks for Probabilistic Image Representations Jos van de Wolfshaar, Andrzej Pronobis (2019).
- From Pixels to Buildings: End-to-end Probabilistic Deep Networks for Large-scale Semantic Mapping Kaiyu Zheng, Andrzej Pronobis (2018)
- Learning Graph-Structured Sum-Product Networks for Probabilistic Semantic Maps Kaiyu Zheng, Andrzej Pronobis, Rajesh P. N. Rao (2018)
- Learning Deep Generative Spatial Models For Mobile Robots Andrzej Pronobis, Rajesh P. N. Rao (2017)
- Learning Semantic Maps With Topological Reasoning Kaiyu Zheng, Andrzej Pronobis, Rajesh P. N. Rao (2017)
Metadata
Release files for libspn 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| libspn-0.1.3.tar.gz | 12.0 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| libspn-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.2 MB
Release files / libspn-0.1.3.tar.gz
| Download URL | libspn-0.1.3.tar.gz |
|---|---|
| Size | 12.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5b75ac59cfbbcf88e577a06d15e70187a24378a2997729b695824550c392d71e
|
|
BLAKE2b-256 checksum How to use checksums |
7a75b1e03d3147c6950221d2e8884d0c5d7684c154a0e1b48bd79997d893861e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / libspn-0.1.3-py3-none-any.whl
| Download URL | libspn-0.1.3-py3-none-any.whl |
|---|---|
| Size | 167.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9b769e1a709907dffebe77fd6b9d49fad4d11dbf48b475b778763cbb56eda0fe
|
|
BLAKE2b-256 checksum How to use checksums |
332264bd75c4144149b3bd9ab5328b5406952016095bb08f042633f77919fc6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|