Giter VIP home page Giter VIP logo

sequence2sequencener's People

Contributors

liah-chan avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sequence2sequencener's Issues

Backward hidden state used to initialize decoder instead of Forward

Hi,

I came across your paper while searching for seq2seq examples with aligned one-to-one mapping from inputs to labels. I appreciate the clarity of the code and am grateful that you made it available.

I haven't been able to run & step through the code yet, but one thing I noticed that seems to differ from the paper is this line where the initial hidden state for the decoder is extracted from the encoder https://github.com/liah-chan/sequence2sequenceNER/blob/master/scripts/train.py#L92:

last_hidden = (encoder_hidden[0][1].unsqueeze(0), encoder_hidden[1][1].unsqueeze(0))

encoder_hidden is the tuple (hidden, cell) each with shape (num_layers * num_directions, batch, hidden_size). It seems that encoder_hidden[0][1] would therefore be the hidden state of the backward direction at word 0, whereas the paper in §4.3 states that the forward output at word=seq_length is the initial hidden state:

On the decoder side, we use a single layer LSTM that generates label predictions step by step from the start to the end of the sentence. The last hidden state of the forward encoder RNN (−→ht) is used as the initial decoder hidden state.

Was your intent to use the forward or backward state for initialization? And do you think it would make a real difference since the decoder also receives the aligned F/B output states for each step?

Thanks!

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.