DeepProbLog

repository·master·Indexed 43 days ago

https://github.com/ml-kuleuven/deepproblog

DeepProbLog integrates Probabilistic Logic Programming with deep learning by introducing neural predicates, allowing neural networks to parameterize probabilistic facts within a logic programming framework. It includes tools for neural-symbolic evaluation via the ArithmeticCircuit class, dataset management with DataLoader and QueryDataset, and support for learnable term embeddings.

Tokens
11.8K
Snippets
48
Records
62
Agent score
55%

What's inside DeepProbLog

  1. Explore DeepProbLog API modules

    master

    DeepProbLog provides several specialized modules for different stages of the machine learning and probabilistic reasoning pipeline:

    • Data & Tensors: deepproblog.embeddings for vector representations, deepproblog.tensor for tensor operations, and deepproblog.dataset for managing training/evaluation data.
    • Logic & Reasoning: deepproblog.query for formulating queries, deepproblog.solver for probabilistic inference, deepproblog.engine for the execution engine, and deepproblog.semiring for semiring-based reasoning.
    • Neural Components: deepproblog.network for neural architectures and deepproblog.arithmetic_circuit for representing arithmetic operations within the logic framework.
    • Training & Evaluation: deepproblog.optimizer for parameter updates, deepproblog.train for the training loop, and deepproblog.evaluate for assessing model performance.
  2. What is DeepProbLog?

    master
    DeepProbLog is an extension of ProbLog that integrates Probabilistic Logic Programming with deep learning. It introduces the neural predicate, which allows you to represent probabilistic facts where the probabilities are parameterized by neural networks. This enables the combination of symbolic reasoning (logic programming) with connectionist learning (deep learning).
  3. Run program induction experiments

    master

    The Forth example directory contains experiments inspired by the paper Programming with a Differentiable Forth Interpreter. These experiments demonstrate program induction using a differentiable Forth interpreter. There are three distinct experiments available:

    1. Learning to add: Executes the addition learning task.
    2. Learning to sort: Executes the sorting learning task.
    3. Solving Word Algebra Problems (WAPs): Executes the WAP solving task.

    Note: The data used in these experiments has been converted to the DeepProbLog format for compatibility, based on the original d4 repository.

    # Learning to add
    python Add/add.py
    
    # Learning to sort
    python Sort/sort.py
    
    # Solving Word Algebra Problems (WAPs)
    python WAP/wap.py
  4. Generate data for the Coins experiment

    master

    The Coins experiment requires Blender 2.79 to generate synthetic data. You can generate training and testing datasets by running the render.py script with the appropriate mode. If Blender is not in your system path, use the -b flag to specify the path to the Blender executable.

    # Generate training data
    python render.py train
    
    # Generate testing data
    python render.py test
    
    # Generate data specifying a custom Blender path
    python render.py train -b /path/to/blender
  5. Download the Commoncore Word Algebra Problem (WAP) Dataset

    master

    The WAP dataset used in the DeepProbLog examples is based on the work by Roy and Roth (2015). To set up the data for the Forth/WAP example, you must manually download the following files from the Roy and Roth fork repository:

    • Full data: questions.json from data/commoncore_crossval/
    • train.tsv: fold1.txt from data/commoncore_dev/
    • dev.tsv: fold0.txt from data/commoncore_dev/
    • test.tsv: fold0.txt from data/commoncore_test/
    https://github.com/ninjin/roy_and_roth_2015/blob/master/data/commoncore_crossval/questions.json
    https://github.com/ninjin/roy_and_roth_2015/blob/master/data/commoncore_dev/fold1.txt
    https://github.com/ninjin/roy_and_roth_2015/blob/master/data/commoncore_dev/fold0.txt
    https://github.com/ninjin/roy_and_roth_2015/blob/master/data/commoncore_test/fold0.txt