LTNtorch: PyTorch Implementation of Logic Tensor Networks

Tommaso Carraro, Luciano Serafini, Fabio Aiolli
9/24/2024
cs.AI

No official code found. Best implementation: tommasocarraro/LTNtorch (163 stars, MIT, PyTorch, last commit 2024-10-02). 1 more below.

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 computational graph, and the weights of the neural model are changed so the knowledge base is maximally satisfied. LTNtorch is the fully documented and tested PyTorch implementation of Logic Tensor Networks. This paper presents the formalization of LTN and how LTNtorch implements it. Moreover, it provides a basic binary classification example.

View on arXivView PDF

Code Implementations(2)

PyTorchMIT

PyTorch implementation of Logic Tensor Networks, a Neural-Symbolic framework.

16328Python, MakefileNov 26, 20212 years agoMIT
frameworkfuzzy-logicmachine-learningneural-symbolic-computingpytorch
PyTorchMIT

PyTorch implementation of Logic Tensor Networks, a Neural-Symbolic framework.

399Python, MakefileMay 2, 20222 years agoMIT
frameworkfuzzy-logicmachine-learningneural-symbolic-computingpytorch

Similar Papers

Cite this paper

@article{carraro2024ltntorch,
  title  = {LTNtorch: PyTorch Implementation of Logic Tensor Networks},
  author = {Tommaso Carraro and Luciano Serafini and Fabio Aiolli},
  year   = {2024},
  eprint = {2409.16045},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2409.16045v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2409.16045.svg)](https://codeofpaper.com/paper/2409.16045)

Discussion