fairseq icon indicating copy to clipboard operation
fairseq copied to clipboard

Question about "prev_output_tokens" in class "FairseqEncoderDecoderModel"

Open XueMoonLit opened this issue 3 years ago • 0 comments

❓ Questions and Help

Before asking:

  1. search the issues.
  2. search the docs.

What is your question?

Code

What have you tried?

What's your environment?

  • fairseq Version (e.g., 1.0 or main): 0.12
  • PyTorch Version (e.g., 1.0): 1.9
  • OS (e.g., Linux):Linux
  • How you installed fairseq (pip, source):pip
  • Build command you used (if compiling from source):
  • Python version:3.8
  • CUDA/cuDNN version:11.1
  • GPU models and configuration:
  • Any other relevant information:

I am debugging the code of Transformer model and have found that "prev_output_tokens" is almost the same as "target". I noticed that "collate" function in "fairseq/data/language_pair_dataset.py" will move "eos" token to the beginning of "target" to create "prev_output_tokens". So, during trainning stage, the samples fed into decoder are in the form of "[eos] [token1] [token2] ...". However, shouldn't "bos" token be at the begining of samples instead of "eos" token like "[bos] [token1] [token2] ...".

XueMoonLit avatar Dec 08 '22 13:12 XueMoonLit