# PyNeuraLogic

[![PyPI version](https://badge.fury.io/py/neuralogic.svg)](https://badge.fury.io/py/neuralogic)
[![License](https://img.shields.io/pypi/l/neuralogic)](https://badge.fury.io/py/neuralogic)



[Documentation](https://pyneuralogic.readthedocs.io/en/latest/) | [Examples](#Examples) | [Papers](https://github.com/GustikS/NeuraLogic#papers)

PyNeuraLogic is a framework built on top of [NeuraLogic](https://github.com/GustikS/NeuraLogic) which combines relational and deep learning.

---

## About

PyNeuraLogic, allows users to encodemachine learning problems via
parameterized, rule-based constructs. Said constructs are based on
a custom declarative language that follows a logicprogramming paradigm

## Getting started

### Supported backends
PyNeuraLogic currenty supports following backends (to some extent), which have to be installed separately:
- [DyNet](https://github.com/clab/dynet)
- Java
- [PyTorch Geometric](https://github.com/rusty1s/pytorch_geometric)

### Prerequisites

To use PyNeuraLogic, you need to have installed the following prerequisites.

```
Python >= 3.7
Java 1.8
```

### Installation

To install PyNeuraLogic's latest release from the PyPI repository, use the following command.

```commandline
$ pip install neuralogic
```

## Examples

- [XOR Example](https://github.com/LukasZahradnik/PyNeuraLogic/blob/master/examples/IntroductionIntoPyNeuraLogic.ipynb)
- [Pattern Matching](https://github.com/LukasZahradnik/PyNeuraLogic/blob/master/examples/PatternMatching.ipynb)
- [Distinguishing k-regular graphs](https://github.com/LukasZahradnik/PyNeuraLogic/blob/master/examples/DistinguishingKRegularGraphs.ipynb)
- [Distinguishing non-regular graphs](https://github.com/LukasZahradnik/PyNeuraLogic/blob/master/examples/DistinguishingNonRegularGraphs.ipynb)
