Code Monkey home page Code Monkey logo

gns-modeling's Introduction

Generative Neuro-Symbolic (GNS) Modeling

This is the source code repository for our paper "Learning Task-General Representations with Generative Neuro-Symbolic Modeling" (Feinman & Lake, 2020).

Setup

This code repository requires Python 3 with PyTorch. We recommend using PyTorch >= 1.5.0, as this version was used for development and testing.

In order to use the provided sources code modules, make sure to add the GNS-Modeling root folder to your python path (Unix machines):

export PYTHONPATH="/path/to/GNS-Modeling:$PYTHONPATH"

pyBPL setup

In order to use this code, you will need to pre-install the pyBPL python library, a separate Python library that we also maintain. Make sure to download the repository and add its root folder to your python path, e.g.:

export PYTHONPATH="/path/to/pyBPL:$PYTHONPATH"

At the moment, pyBPL uses the bottom-up parser from the BPL matlab code during inference. Therefore to use our inference algorithms you will need to download the BPL matlab repository and install the MATLAB Engine API for Python to call its functions from python. Make sure you have created an environment variable BPL_PATH that points to the BPL base directory.

Note: we are working on re-implementing the bottom-up parser in pyBPL. Once complete, pyBPL will be a fully self-contained python package.

Running Experiments

After completing the setup steps above, navigate to the experiments/ directory to find scripts for running our experiments with the GNS model. Each experiment has its own unique sub-directory and a README with directions for running the experiment scripts. Some experiments require a cluster to complete in reasonable time, and we've included python scripts to execute cluster jobs using the submitit package for Slurm cluster scheduling.

Development Notes

We are still working to clean up some of the experiment code and appologize if some pieces are missing or unclear.

Citing

Please cite our paper:

Feinman, R. and Lake, B. M. (2020). Learning task-general representations with Generative Neuro-Symbolic Modeling. arXiv preprint arXiv:2006.14448.

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.