LTNtorch: PyTorch Implementation of Logic Tensor Networks
Tommaso Carraro, Luciano Serafini, Fabio Aiolli

TL;DR
LTNtorch is a PyTorch implementation of Logic Tensor Networks, enabling neural-symbolic learning by integrating logical reasoning with deep learning through gradient-based optimization.
Contribution
This work provides a fully documented, tested PyTorch framework for Logic Tensor Networks, facilitating neuro-symbolic learning and reasoning tasks.
Findings
Successful implementation of LTN in PyTorch
Demonstration with a binary classification example
Framework enables logical reasoning in neural models
Abstract
Logic Tensor Networks (LTN) is a Neuro-Symbolic framework that effectively incorporates deep learning and logical reasoning. In particular, LTN allows defining a logical knowledge base and using it as the objective of a neural model. This makes learning by logical reasoning possible as the parameters of the model are optimized by minimizing a loss function composed of a set of logical formulas expressing facts about the learning task. The framework learns via gradient-descent optimization. Fuzzy logic, a relaxation of classical logic permitting continuous truth values in the interval [0,1], makes this learning possible. Specifically, the training of an LTN consists of three steps. Firstly, (1) the training data is used to ground the formulas. Then, (2) the formulas are evaluated, and the loss function is computed. Lastly, (3) the gradients are back-propagated through the logical…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsFormal Methods in Verification · Embedded Systems Design Techniques · Logic, programming, and type systems
MethodsSparse Evolutionary Training · Balanced Selection
