fairseq
fairseq copied to clipboard
Question about "prev_output_tokens" in class "FairseqEncoderDecoderModel"
❓ Questions and Help
Before asking:
- search the issues.
- 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] ...".