LukasZahradnik/PyNeuraLogic

PyNeuraLogic lets you use Python to create Differentiable Logic Programs

What it solves

PyNeuraLogic addresses the limitations of standard Graph Neural Networks (GNNs) by allowing users to define models using differentiable logic programs. This enables the creation of highly expressive relational learning models that can handle complex structures like hypergraphs, nested graphs, and relational databases, which are often difficult to represent in traditional black-box GNN frameworks.

How it works

It uses a declarative logic programming paradigm where users define logical variables and relations. Through the NeuraLogic backend, the inference process of these logic programs is made differentiable, making it equivalent to forward propagation in deep learning. This allows the system to learn numeric parameters (weights) associated with the rules. The backend engine automatically creates the underlying differentiable computation graphs, removing the need for manual tensor alignment.

Who it’s for

Researchers and developers working on relational machine learning, GNNs, and neural-symbolic integration who need more expressiveness than standard GNN frameworks provide.

Highlights

  • Differentiable Logic Programs: Write logic rules that function as neural network layers.
  • Beyond GNNs: Supports hypergraphs, relational databases, and complex relational pattern matching.
  • High Performance: Benchmarks indicate it can be faster than popular GNN frameworks for certain applications like molecular learning.
  • Predefined Modules: Includes built-in support for GCNConv, SAGEConv, GINConv, RGCNConv, Transformers, LSTMs, and GRUs.