Giter VIP home page Giter VIP logo

local_attention's Introduction

A TensorFlow Implementation of the “Local Attention” in paper: Effective Approaches to Attention-based Neural Machine Translation    

Why this project?  

Attention is a useful machenism in NMT. Recently, the paper "Attention ia all you need" shows a new network architecture which based solely on attention machenisms. I have two goals with this project. One is to have a full understanding of attention machenism and the paper "Effective Approaches to Attention-based Neural Machine Translation". Another is to implement "local attention" by using tensorflow, since I didn't find the corresponding function in tensorflow.

File description  

  • data_utils.py data preparation, the same one with Tensorflow: tutorials/rnn/translate/data_tuils.py    
  • seq2seq_model.py the same one with Tensorflow: tutorials/rnn/translate/data_tuils.py    
  • translate.py the same one with Tensorflow: tutorials/rnn/translate/data_tuils.py    
  • seq2seq_local.py attention decoeder function. Implement the "local attention" in
    function "local_attention_decoder". Another attention function,
    implements to calculate the new alignment weights with Gaussian
    distribution but not sets the window, is named "local_attention_decodere_nowindow".
    Function "attention_decoder" is the original one in tensorflow.

Training  

Just use the same command line in Tensorflow tutorial:   python translate.py  

--data_dir [your_data_directory] --train_dir [checkpoints_directory]

--en_vocab_size=40000 --fr_vocab_size=40000

local_attention's People

Contributors

qiu19qq avatar

Stargazers

 avatar Xi Zhou avatar  avatar  avatar  avatar  avatar KunWang avatar  avatar Aravind Sankar avatar Miraitowa` avatar xuhaiyang-mPLUG avatar  avatar  avatar

Watchers

James Cloos 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.