ML-KULeuven/deepproblog

DeepProbLog is an extension of ProbLog that integrates Probabilistic Logic Programming with deep learning by introducing the neural predicate.

DeepProbLog – Neural Probabilistic Logic Programming

What it is – DeepProbLog extends the ProbLog probabilistic logic programming language by adding neural predicates. These are facts whose probabilities are produced by a neural network, letting you combine symbolic reasoning with deep‑learning perception in a single model.

Key components

  • ProbLog integration – builds on the existing ProbLog system for defining probabilistic logical programs.
  • Neural predicates – wrap PyTorch models (e.g., CNNs from TorchVision) so that the truth‑value of a predicate is a learned probability.
  • Inference – supports exact inference via the underlying ProbLog engine and optional approximate inference when the extra dependencies (PySwip + SWI‑Prolog) are installed.
  • Examples – the repository ships a src/deepproblog/examples folder containing the experiments described in the accompanying research papers.

Installation

pip install deepproblog   # pulls in ProbLog, PySDD, PyTorch, TorchVision, etc.

For testing you also need pytest and can run the built‑in test suite with:

python -m deepproblog test

If you want to use the approximate inference mode, install the extra packages pyswip and have SWI‑Prolog available on your system.

Use case – Write a ProbLog program that reasons over uncertain facts, and let some of those facts be classified by a neural network (e.g., image recognition). DeepProbLog will train the neural components while performing probabilistic inference over the whole program.

Publications

  1. DeepProbLog: Neural Probabilistic Logic Programming (NeurIPS 2018)
  2. Neural Probabilistic Logic Programming in DeepProbLog (AIJ)
  3. Approximate Inference for Neural Probabilistic Logic Programming (KR 2021)

License – Apache 2.0 (KU Leuven, DTAI Research Group).


All information above is taken directly from the repository’s README.

Related

  • Project
  • Project
  • Project
  • Project