Using embedding weights for further calculations ok?

Hey there,

I have a quick question. I am using an Embedding space in my model and my final step is to get a score for each object in the embedding space. So my approach is to just multiply with the transposed weights:

self.embed = nn.Embedding(..)
...
scores = out.mm(self.embed.weight.t())

Is that fine in terms of autograd? Are the embedding weights updated in terms of the matrix multiplication?

Thanks,
Magnus

1 Like

Hi,
Yes this will work as you expect.

2 Likes