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

vocab = n_vocab + n_special + n_ctx means? #54

Open
JiahangOK opened this issue Apr 5, 2019 · 1 comment
Open

vocab = n_vocab + n_special + n_ctx means? #54

JiahangOK opened this issue Apr 5, 2019 · 1 comment

Comments

@JiahangOK
Copy link

I know that n_vocab is the total number of tokens in encoder dictionary. But when I saw vocab = n_vocab + n_special + n_ctx, I was confused, maybe n_special is the for start,delimiter and classify. But what is n_ctx? Why add these 3 things? (why there is little comment about variables and functions....Is there somewhere else to see the explanation of the codes?) I am new to learn about the transformer.

@LeeRel1991
Copy link

from #28

  • n_ctx is the maximum number of token in an input sequence.
  • n_special is the number of special tokens used to format the input properly. For example in the ROCStories problem, we use 3 additional tokens, start, delimiter and classify
  • n_vocab should be the actual valid tokens

the reason for adding is that each token in a sentence should also has a position encoding(here, position embedding is used, similar to word embedding.

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

2 participants