Skip to main content

Logical Reasoning for Deep Nets

Project description

========= Pymetheus

.. image:: https://img.shields.io/pypi/v/pymetheus.svg :target: https://pypi.python.org/pypi/pymetheus

.. image:: https://img.shields.io/travis/vinid/pymetheus.svg :target: https://travis-ci.org/vinid/pymetheus

.. image:: https://readthedocs.org/projects/pymetheus/badge/?version=latest :target: https://pymetheus.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status

PyMetheus: Deep Nets for Logical Reasoning

Features

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

Features

  • 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

ll.constant("Rome")
ll.constant("Milan")
ll.constant("Italy")

..

  • Introduce Some Predicates and Knowledge

.. code-block:: python

ll.predicate("capital")
ll.predicate("country")

ll.knowledge("country(Milan,Italy)")
ll.knowledge("capital(Rome,Italy)")

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)

..

Credits

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

.. _Cookiecutter: https://github.com/audreyr/cookiecutter .. _audreyr/cookiecutter-pypackage: https://github.com/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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

Details for the file pymetheus-0.3.1.tar.gz.

File metadata

  • Download URL: pymetheus-0.3.1.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.5

File hashes

Hashes for pymetheus-0.3.1.tar.gz
Algorithm Hash digest
SHA256 f3e2175ad594f7190dd110e0e73f8c5901a474b3968a92a8d9f4809af64afebe
MD5 89b934411d477b9eb893c3ec8f4d2245
BLAKE2b-256 e907dd009f0a0347f4c4d9fb87776c0df5ad254b121a5030146eaa3bb22d6ee5

See more details on using hashes here.

File details

Details for the file pymetheus-0.3.1-py2.py3-none-any.whl.

File metadata

  • Download URL: pymetheus-0.3.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.5

File hashes

Hashes for pymetheus-0.3.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 acc88b8b93eb7f2d491170212743f739b02cda0533ad69b0cdc19b66fda34168
MD5 ee2d8cee25cd30a231382cabe7c0a9ec
BLAKE2b-256 ab54832a5f8b40d2479e651074c0a3d9a0d3cd119e433fd19776e40991b9ca93

See more details on using hashes here.

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