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

Confusion regarding embedding space #186

Open
IamAdiSri opened this issue Sep 8, 2021 · 2 comments
Open

Confusion regarding embedding space #186

IamAdiSri opened this issue Sep 8, 2021 · 2 comments

Comments

@IamAdiSri
Copy link

IamAdiSri commented Sep 8, 2021

The paper says, "...the same weight matrix is shared between the two embedding layers..." referring to the encoder and decoder embedding layers respectively. However, in the lines below I can see that the encoder initializes its own embedding matrix, separate from the one in the decoder. Can you explain why this is so?

self.src_word_emb = nn.Embedding(n_src_vocab, d_word_vec, padding_idx=pad_idx)

self.trg_word_emb = nn.Embedding(n_trg_vocab, d_word_vec, padding_idx=pad_idx)

@kian98
Copy link

kian98 commented Dec 6, 2021

Weights are shared in the __init__ function of class Transformer

if trg_emb_prj_weight_sharing:

if emb_src_trg_weight_sharing:

@chaudharynabin6
Copy link

i am also confused on that key , query , value get's trained or the embedding get's trained please help

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

3 participants