arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2409.16045cs.AI
收藏

LTNtorch:Logic Tensor Networks 的 PyTorch 实现

LTNtorch: PyTorch Implementation of Logic Tensor Networks

University of Padova(帕多瓦大学);Fondazione Bruno Kessler(布鲁诺·凯塞勒基金会)

Tommaso Carraro, Luciano Serafini, Fabio Aiolli

AI总结:

LTNtorch 是 Logic Tensor Networks 的 PyTorch 实现,通过结合深度学习与逻辑推理,将逻辑知识库作为神经模型的目标,利用 Fuzzy logic 和梯度下降优化实现基于逻辑的学习。

摘要:

Logic Tensor Networks (LTN) 是一种有效结合深度学习与逻辑推理的 Neuro-Symbolic 框架。具体而言,LTN 允许定义逻辑知识库并将其作为神经模型的目标。这使得通过逻辑推理进行学习成为可能,因为模型的参数是通过最小化损失函数来优化的,该损失函数由一组表达学习任务事实的逻辑公式组成。该框架通过梯度下降优化进行学习。Fuzzy logic 作为经典逻辑的松弛,允许在区间 [0,1] 内使用连续真值,使这种学习成为可能。具体来说,LTN 的训练包含三个步骤。首先,(1) 使用训练数据对公式进行接地。然后,(2) 评估公式并计算损失函数。最后,(3) 通过逻辑计算图反向传播梯度,并改变神经模型的权重,从而使知识库得到最大程度的满足。LTNtorch 是 Logic Tensor Networks 的完整文档化和经过测试的 PyTorch 实现。本文介绍了 LTN 的形式化以及 LTNtorch 如何实现它。此外,还提供了一个基础的二元分类示例。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑