Skip to content

BERT4Rec item_embedding padding问题 #1227

Answered by leoleojie
hlyu9 asked this question in Q&A
Discussion options

You must be logged in to vote

@hlyu9 您好!感谢您的关注!

  1. 如您所说,定义的self.item_embedding为nn.Embedding(self.n_items + 1, self.hidden_size, padding_idx=0),其中0对应的是pad,self.n_items对应的是[MASK]. 因此在后续处理的时候,使用self.item_embedding.weight[:self.n_items],得到除[MASK]外的item_embedding.
  2. 是的,可以利用它来提取feature信息。

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@kuzma-long
Comment options

@leoleojie
Comment options

@kuzma-long
Comment options

@hlyu9
Comment options

@kuzma-long
Comment options

Answer selected by hlyu9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
3 participants