Giter VIP home page Giter VIP logo

lang2logic's Introduction

Setup

  • If you have already installed Torch7, please rename its folder name.
mv ~/torch ~/torch_bak
  • Download Torch7
git clone https://github.com/torch/distro.git ~/torch --recursive
cd ~/torch; bash install-deps;
  • Replace ~/torch/extra/cunn/lib/THCUNN/ClassNLLCriterion.cu with the one in the ./install folder.

The original ClassNLLCriterion.cu throws an error when the input is 0. We modify this file to make it accept 0.

  • Install Torch7
cd ~/torch
./install.sh
# On Linux with bash
source ~/.bashrc
  • Install dependency
luarocks install class
pip install path.py
  • Pull data
python pull_data.py

Usage

  • Run pretrained models
./pretrain.sh [seq2seq|seq2tree] [jobqueries|geoqueries|atis] [lstm|attention] GPU_ID
# run seq2seq without attention
./pretrain.sh seq2seq jobqueries lstm
# print results
cat seq2seq/jobqueries/dump_lstm/pretrain.t7.sample
# run seq2seq with attention
./pretrain.sh seq2seq jobqueries attention
# print results
cat seq2seq/jobqueries/dump_attention/pretrain.t7.sample
  • Run experiments
./run.sh [seq2seq|seq2tree] [jobqueries|geoqueries|atis] [lstm|attention] GPU_ID
# run seq2seq without attention
./run.sh seq2seq jobqueries lstm
# print results
cat seq2seq/jobqueries/dump_lstm/model.t7.sample
# run seq2seq with attention
./run.sh seq2seq jobqueries attention
# print results
cat seq2seq/jobqueries/dump_attention/model.t7.sample

Environment

The code is only tested on the above environment.

lang2logic's People

Contributors

donglixp 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.