Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpretation of 'decoderInputs' in dataset.lua #56

Open
nabihach opened this issue Sep 21, 2016 · 0 comments
Open

Interpretation of 'decoderInputs' in dataset.lua #56

nabihach opened this issue Sep 21, 2016 · 0 comments

Comments

@nabihach
Copy link

I'm looking at dataset.lua, where decoderInputs are being set up.

    decoderInputs = torch.IntTensor(maxTargetOutputSeqLen-1,size):fill(0)

    for samplenb = 1, #targetSeqs do
      trimmedEosToken = targetSeqs[samplenb]:sub(1,-2)
      for word = 1, trimmedEosToken:size(1) do
        if size == 1 then
          decoderInputs[word] = trimmedEosToken[word]
        else
          decoderInputs[word][samplenb] = trimmedEosToken[word]
        end
      end
    end

This tensor is then used in model.decoder:forward(decoderInputs) in train.lua. My question is, how (and why) is this tensor different from encoderInputs?

I ask this because when we evaluate the model using eval.lua, we simply pass the decoder's own output at each time step into model.decoder:forward (see Seq2Seq:eval(input), where we have the line
local prediction = self.decoder:forward(torch.Tensor(output))[#output] ).

Help would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant