harvardnlp / annotated-transformer

An annotated implementation of the Transformer paper.
http://nlp.seas.harvard.edu/annotated-transformer
MIT License
5.7k stars 1.23k forks source link

The first column of synthetic data in the first example should be set to 0 instead of 1? #116

Open alaneuler opened 1 year ago

alaneuler commented 1 year ago

Skimmed through old version of "annotated-transformer" the start_symbol is 1:

image

but changed to 0 afterwards. Should the code in method data_gen also be changed to 0 for consistence?

image
rocinant commented 4 months ago

I get same question here.

rocinant commented 4 months ago

i tried both, change data[:, 0] = 1 to data[:, 0] = 0 should be right.

Skimmed through old version of "annotated-transformer" the start_symbol is 1: image but changed to 0 afterwards. Should the code in method data_gen also be changed to 0 for consistence? image