Code Monkey home page Code Monkey logo

sequence-to-sequence's Introduction

sequence-to-sequence

Sequence to sequence tutorial implemented with PyTorch.

Install

# Clone the project.
git clone https://github.com/ProFatXuanAll/sequence-to-sequence.git

# Install dependencies.
pipenv install

Train Tokenizer

Train Source Text Tokenizer

python run_train_tknzr.py \
character \
--exp_name 'src_tknzr' \
--dset_name 'arithmetic.src' \
--min_count 1 \
--n_vocab 20 \
--is_cased

Train Target Text Tokenizer

python run_train_tknzr.py \
character \
--exp_name 'tgt_tknzr' \
--dset_name 'arithmetic.tgt' \
--min_count 1 \
--n_vocab 15 \
--is_cased

Train Model

python run_train_model.py \
GRU \
--batch_size 2048 \
--ckpt_step 5000 \
--dec_d_emb 20 \
--dec_d_hid 40 \
--dec_dropout 0.0 \
--dec_n_layer 1 \
--dec_max_len 7 \
--dec_tknzr_exp 'tgt_tknzr' \
--dset_name 'arithmetic' \
--enc_d_emb 20 \
--enc_d_hid 40 \
--enc_dropout 0.0 \
--enc_n_layer 1 \
--enc_max_len 12 \
--enc_tknzr_exp 'src_tknzr' \
--epoch 100 \
--exp_name 'my_exp' \
--log_step 2500 \
--lr 5e-4 \
--max_norm 1.0 \
--seed 42

Evaluate Model

python run_eval_model.py \
  --batch_size 1024 \
  --ckpt -1 \
  --dset_name 'arithmetic' \
  --exp_name 'my_exp' \
  --infr_name 'top_1'

Infer Model

python run_infr_model.py \
  --ckpt -1 \
  --exp_name 'my_exp' \
  --infr_name 'top_1' \
  --src '1+1='

sequence-to-sequence's People

Contributors

nail1021734 avatar profatxuanall avatar

Stargazers

 avatar  avatar

Watchers

 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.