Giter Club home page Giter Club logo

machine-translation_sfsj's Introduction

Machine-Translation

Sequence-to-Sequence machine translation model

Prerequisites

  1. Python (2.7)
  2. NumPy (1.11.2)
  3. Tensorflow (0.11)

Usage

To train a model with 1 hidden LSTM layer having 2 units and 10 batch size:

$ python main.py --num_hidden_layers 1 --num_units 2 --batch_size 10

To see all options, run:

$ python main.py -h

which will print:

usage: main.py [-h] [--batch_size BATCH_SIZE]
               [--max_train_data_size MAX_TRAIN_DATA_SIZE]
               [--num_units NUM_UNITS] [--num_hidden_layers NUM_HIDDEN_LAYERS]
               [--learning_rate LEARNING_RATE]
               [--learning_rate_decay_factor LEARNING_RATE_DECAY_FACTOR]
               [--max_gradient_norm MAX_GRADIENT_NORM]
               [--num_samples NUM_SAMPLES]
               [--en_vocabulary_size EN_VOCABULARY_SIZE]
               [--fr_vocabulary_size FR_VOCABULARY_SIZE]
               [--target_vocab TARGET_VOCAB]
               [--checkpoint_step CHECKPOINT_STEP] [--train [TRAIN]]
               [--notrain] [--dataset DATASET] [--model_name MODEL_NAME]
               [--dataset_dir DATASET_DIR] [--checkpoint_dir CHECKPOINT_DIR]

optional arguments:
  -h, --help            show this help message and exit
  --batch_size BATCH_SIZE
                        Size of training batch
  --max_train_data_size MAX_TRAIN_DATA_SIZE
                        Limit on the size of training data (0: no limit)
  --num_units NUM_UNITS
                        Number of units in LSTM layer
  --num_hidden_layers NUM_HIDDEN_LAYERS
                        Number of hidden LSTM layers
  --learning_rate LEARNING_RATE
                        Initial learning rate
  --learning_rate_decay_factor LEARNING_RATE_DECAY_FACTOR
                        Learning rate decays by this much
  --max_gradient_norm MAX_GRADIENT_NORM
                        Clip gradients to this norm
  --num_samples NUM_SAMPLES
                        Number of samples for sampled softmax
  --en_vocabulary_size EN_VOCABULARY_SIZE
                        English vocabulary size
  --fr_vocabulary_size FR_VOCABULARY_SIZE
                        French vocabulary size
  --target_vocab TARGET_VOCAB
                        Target vocabulary (en/fr)
  --checkpoint_step CHECKPOINT_STEP
                        Number of training steps per checkpoint
  --train [TRAIN]       True for training, False for validating
  --notrain
  --dataset DATASET     Name of the dataset file
  --model_name MODEL_NAME
                        Name of the model
  --dataset_dir DATASET_DIR
                        Directory name for the dataset
  --checkpoint_dir CHECKPOINT_DIR
                        Directory name to save the checkpoint

License

The MIT License (MIT)

machine-translation_sfsj's People

Contributors

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