GithubHelp home page GithubHelp logo

nacs's Introduction

NACS

A simple sequence-to-sequence toolkit for doing experiments with SCAN and NACS.

Installation

First install all requirements, e.g. pip install -r requirements.txt

Before use, make sure to compile the extensions:

  • python setup.py build develop

Usage

Example on simple data set (enc-dec with attention):

python -m seq2seq --mode train --root data/scan/simple --src src --trg trg --train train_wo_valid_random --validation valid.random --test test --batch_size 32 --n_iters -50 --dropout 0.2 --dim 256 --emb_dim 64 --metric exact_match --seed 1 --workdir ./seq2seq_model 

Or with more options:

python -m seq2seq --mode train --model_type encdec --enc_type birnn --dec_type rnn_att --rnn_type gru --n_enc_layers 1 --n_dec_layers 1 --root data/scan/simple --src src --trg trg --train train_wo_valid_random --validation valid.random --test test --batch_size 32 --n_iters -50 --learning_rate 0.2 --optimizer sgd --clip 5 --eval_every -1 --print_every 100 --dropout 0.2 --dim 256 --emb_dim 64 --metric exact_match --seed 1 --workdir ./seq2seq_model --pass_hidden_state 1 --n_val_examples 5 --use_visdom --unk_src 0 --unk_trg 0 --predict_from_emb 0 --predict_from_ctx 1 --predict_from_dec 1 --dec_input_emb 1 --dec_input_ctx 1

Full list of options

usage: __main__.py [-h] --mode {train,test} [--model_type {encdec,model1}]
                   [--enc_type {rnn,birnn}] [--dec_type {rnn,rnn_att}]
                   [--src SRC] [--trg TRG] [--root ROOT] [--train TRAIN]
                   [--validation VALIDATION [VALIDATION ...]] [--test TEST]
                   [--workdir WORKDIR] [--emb_dim EMB_DIM] [--dim DIM]
                   [--batch_size BATCH_SIZE] [--n_enc_layers N_ENC_LAYERS]
                   [--n_dec_layers N_DEC_LAYERS] [--rnn_type {lstm,gru,rnn}]
                   [--use_visdom] [--n_val_examples N_VAL_EXAMPLES]
                   [--min_freq MIN_FREQ] [--tf_ratio TF_RATIO] [--seed SEED]
                   [--dropout DROPOUT] [--weight_decay WEIGHT_DECAY]
                   [--learning_rate LEARNING_RATE]
                   [--learning_rate_decay LEARNING_RATE_DECAY]
                   [--optimizer {adam,sgd}] [--clip CLIP] [--n_iters N_ITERS]
                   [--predict_from_emb PREDICT_FROM_EMB]
                   [--predict_from_ctx PREDICT_FROM_CTX]
                   [--predict_from_dec PREDICT_FROM_DEC]
                   [--dec_input_emb DEC_INPUT_EMB]
                   [--dec_input_ctx DEC_INPUT_CTX] [--save_every SAVE_EVERY]
                   [--print_every PRINT_EVERY] [--plot_every PLOT_EVERY]
                   [--eval_every EVAL_EVERY] [--resume RESUME]
                   [--max_length MAX_LENGTH]
                   [--max_length_train MAX_LENGTH_TRAIN]
                   [--metric {exact_match,accuracy,perplexity,bleu}]
                   [--ckpt CKPT] [--src_vocab SRC_VOCAB]
                   [--trg_vocab TRG_VOCAB] [--src_tags_vocab SRC_TAGS_VOCAB]
                   [--trg_tags_vocab TRG_TAGS_VOCAB] [--pointer POINTER]
                   [--save_heatmaps SAVE_HEATMAPS]
                   [--external_bleu EXTERNAL_BLEU] [--debpe DEBPE]
                   [--unk_src UNK_SRC] [--unk_trg UNK_TRG]
                   [--pass_hidden_state PASS_HIDDEN_STATE]
                   [--scan_normalize SCAN_NORMALIZE]
                   [--num_composed_commands NUM_COMPOSED_COMMANDS]
                   [--ctx_dim CTX_DIM]

License

NACS is CC-NC licensed, as found in the LICENSE file.

nacs's People

Contributors

bastings avatar douwekiela avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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