-
大佬们好,想请教一个关于BERT4Rec代码细节的问题:
想请教两个问题:
|
Beta Was this translation helpful? Give feedback.
Answered by
leoleojie
Apr 6, 2022
Replies: 1 comment 5 replies
-
@hlyu9 您好!感谢您的关注!
|
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
hlyu9
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@hlyu9 您好!感谢您的关注!
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.