Deep Learning and Logical Reasoning from Data and Knowledge
Branch: master
Clone or download
Latest commit 0c29e89 Dec 31, 2018

Logic Tensor Networks (LTN)


The following is what we are using for development. Basically similar versions should run fine.

  • python3.6
  • tensorflow >=1.8 (for running the core, wrapper etc)
  • numpy >= 1.13.3 (for examples and tests)
  • matplotlib >= 2.1 (for examples)

Installing dependencies is easy. Just use pip install tensorflow numpy matplotlib or use a virtualenv.

Repository structure

  • -- core system for defining constants, variables, predicates, functions and formulas.
  • -- a simple wrapper that allows to express constants, variables, predicates, functions and formulas using strings.
  • -- a collection of useful functions.
  • examples_ltn -- examples using the core system
  • examples_ltnw -- examples using the wrapper
  • tests -- tests

Running tests

Tests are in tests and should be run from the project root. To run all available tests use python3.6 tests/

Currently, tests are for the wrapper.

Running examples

There are various examples for LTN core examples_ltn and how to use the wrapper examples_ltnw.

Run examples from the project root, e.g. python3.6 examples_ltn/



Checkout recent tutorials on Logic Tensor Networks (LTN)

Other resources


This project is licensed under the MIT License - see the LICENSE file for details


LTN has been developed thanks to active contributions and discussions with the following people:

  • Alessandro Daniele (FBK)
  • Artur d’Avila Garces (City)
  • Francesco Giannini (UniSiena)
  • Giuseppe Marra (UniSiena)
  • Ivan Donadello (FBK)
  • Lucas Brukberger (UniOsnabruck)
  • Luciano Serafini (FBK)
  • Marco Gori (UniSiena)
  • Michael Spranger (Sony CSL)
  • Michelangelo Diligenti (UniSiena)