Skip to content

Use output of nn.Embed as a Layer #1981

Answered by marcvanzee
pharringtonp19 asked this question in Q&A
Discussion options

You must be logged in to vote

In your example you have a 10x5 embedding table (i.e., 10 embeddings of size 5). emb contains the embeddings of your input c using that embedding table (so it is an array), so emb(x) doesn't mean anything.

Do you mean you want to add a linear layer after the embedding layer? Then you should use Dense and pass it emb.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@pharringtonp19
Comment options

@marcvanzee
Comment options

@marcvanzee
Comment options

@pharringtonp19
Comment options

Answer selected by pharringtonp19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants