Skip to main content

Logical Reasoning for Deep Nets

Project description

========= Pymetheus

.. image:: :target:

.. image:: :target:

.. image:: :target: :alt: Documentation Status

PyMetheus: Deep Nets for Logical Reasoning


  • Provides an out of the box tool to learn (fuzz) first order logic with the use of an underlying vector space


  • Create a Logic Deep Network

.. code-block:: python

import pymetheus
import itertools
from pymetheus.pymetheus import LogicNet

ll = LogicNet()


  • Introduce Some Constants

.. code-block:: python



  • Introduce Some Predicates and Knowledge

.. code-block:: python



ll.zeroing() # Initialize KB with all knowledge as false


  • Add quantified rule with data .. code-block:: python

    rule = "forall ?a,?b: capital(?a,?b) -> country(?a,?b)" ll.universal_rule(rule) var = ["Italy", "Rome", "Milan"] ll.variable("?a", var) ll.variable("?b", var) ..

  • Learn and Reason

.. code-block:: python

ll.learn(epochs=1000, batch_size=25)

ll.reason("capital(Rome,Italy)", True)



This package was created with Cookiecutter_ and the audreyr/cookiecutter-pypackage_ project template.

.. _Cookiecutter: .. _audreyr/cookiecutter-pypackage:

======= History

0.1.0 (2019-08-22)

  • First release on PyPI.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymetheus-0.3.1.tar.gz (17.1 kB view hashes)

Uploaded source

Built Distribution

pymetheus-0.3.1-py2.py3-none-any.whl (13.9 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page