Git Product home page Git Product logo

lnn's Introduction

Build Status License CII Best Practices Code style: black

Logical Neural Networks

LNNs are a novel Neuro = Symbolic framework designed to seamlessly provide key properties of both neural nets (learning) and symbolic logic (knowledge and reasoning).

  • Every neuron has a meaning as a component of a formula in a weighted real-valued logic, yielding a highly interpretable disentangled representation.
  • Inference is omnidirectional rather than focused on predefined target variables, and corresponds to logical reasoning, including classical first-order logic theorem proving as a special case.
  • The model is end-to-end differentiable, and learning minimizes a novel loss function capturing logical contradiction, yielding resilience to inconsistent knowledge.
  • It also enables the open-world assumption by maintaining bounds on truth values which can have probabilistic semantics, yielding resilience to incomplete knowledge.

Quickstart

To install the LNN:

  1. Install GraphViz and gmp (libgmp3-dev)

    Tips for installing Graphviz
    If you experience a "graphviz/cgraph.h" file not found error, try the following:
    # Using Conda
    conda install -c anaconda graphviz

    Alternatively you can install the OS specific versions as follows:

    # Ubuntu and Debian
    sudo apt-get install graphviz graphviz-dev
    # MacOS
    brew install graphviz
    # Windows / Powershell
    sudo apt-get install python3-dev graphviz libgraphviz-dev pkg-config
    Tips for installing gmp

    If you experience a "gmp.h" file not found error, try the following:

    # MacOS
    brew install gmp
    env "CFLAGS=-I/usr/local/include -L/usr/local/lib" pip install pycddlib
    # Windows Powershell / Anaconda 
    conda install --channel conda-forge pygraphviz
    # Ubuntu and Debian
    sudo apt-get install python3-dev graphviz libgraphviz-dev pkg-config
    sudo -H apt-get install libgmp-dev python3-dev
  2. Make sure that the python version you use in line with our setup file, using a fresh environment is always a good idea:

    conda create -n lnn python=3.9 -y
    conda activate lnn
    
  3. Install the LNN as a library:

    pip install git+https://github.com/IBM/LNN.git
    

Contribution

Contributions to the LNN codebase are welcome!

Please have a look at the contribution guide for more information on how to set up the LNN for contributing and how to follow our development standards.

Documentation

Read the Docs Academic Papers Educational Resources Neuro-Symbolic AI API Overview Python Module
Docs Academic Papers Getting Started Neuro-Symbolic AI API Python Module

Citation

If you use Logical Neural Networks for research, please consider citing the reference paper:

@article{riegel2020logical,
  title={Logical neural networks},
  author={Riegel, Ryan and Gray, Alexander and Luus, Francois and Khan, Naweed and Makondo, Ndivhuwo and Akhalwaya, Ismail Yunus and Qian, Haifeng and Fagin, Ronald and Barahona, Francisco and Sharma, Udit and others},
  journal={arXiv preprint arXiv:2006.13155},
  year={2020}
}

lnn's People

Contributors

naweedaghmad avatar mikulatomas avatar kyleerwin avatar momolefe24 avatar imgbotapp avatar ibm-open-source-bot avatar mwbaert avatar namin avatar ndiv avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.