Git Product home page Git Product logo

abl-hed's Introduction

Abductive Learning for Handwritten Equation Decipherment

This is the code repository of the abductive learning framework for handwritten equation decipherment experiments in Bridging Machine Learning and Logical Reasoning by Abductive Learning in NeurIPS 2019.

Environment dependency

This code is only tested in Linux environment.

  1. Swi-Prolog
  2. Python3 with Numpy, Tensorflow and Keras
  3. ZOOpt (as a submodule)

Install Swipl

http://www.swi-prolog.org/build/unix.html

Install python3

https://wiki.python.org/moin/BeginnersGuide/Download

Install required package

#install numpy tensorflow keras
pip3 install numpy
pip3 install tensorflow
pip3 install keras
pip3 install zoopt

Set environment variables(Should change file path according to your situation)

# cd to ABL-HED
git submodule update --init --recursive

export ABL_HOME=$PWD
cp /usr/local/lib/swipl/lib/x86_64-linux/libswipl.so $ABL_HOME/src/logic/lib/
export LD_LIBRARY_PATH=$ABL_HOME/src/logic/lib
export SWI_HOME_DIR=/usr/local/lib/swipl/

# for GPU user
export LD_LIBRARY_PATH=$ABL_HOME/src/logic/lib:/usr/local/cuda:$LD_LIBRARY_PATH

Install Abductive Learning code

First change the swipl_include_dir and swipl_lib_dir in setup.py to your own SWI-Prolog path.

cd src/logic/prolog
python3 setup.py install

Demo for arithmetic addition learning

Change directory to ABL-HED, and run equaiton generator to get the training data

cd src/
python3 equation_generator.py

Run abductive learning code

cd src/
python3 main.py

or

python3 main.py --help

To test the RBA example, please specify the src_data_name and src_data_file together, e.g.,

python main.py --src_data_name random_images --src_data_file random_equation_data_train_len_26_test_len_26_sys_2_.pk

Authors

abl-hed's People

Contributors

abductivelearning avatar

Watchers

James Cloos 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.