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

[🐛BUG] ContextRecommender类的double_tower_embed_input_fields函数中token_seq_embedding和token_embedding的赋值次序有误 #1175

Closed
biqi1110 opened this issue Mar 7, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@biqi1110
Copy link

biqi1110 commented Mar 7, 2022

embed_input_fields函数中sparse_embedding拼接token类特征embedding在token_seq之前,如下:

  if token_fields_embedding is None:
      sparse_embedding = token_seq_fields_embedding
  else:
      if token_seq_fields_embedding is None:
          sparse_embedding = token_fields_embedding
      else:
          sparse_embedding = torch.cat([token_fields_embedding, token_seq_fields_embedding], dim=1)

而在double_tower_embed_input_fields函数中对sparse_embedding 拆分时,token类特征embedding在token_seq之后,如下:

  if sparse_embedding is not None:
      sizes = [
          self.user_token_seq_field_num, self.item_token_seq_field_num, self.user_token_field_num,
          self.item_token_field_num
      ]
      first_token_seq_embedding, second_token_seq_embedding, first_token_embedding, second_token_embedding = \
          torch.split(sparse_embedding, sizes, dim=1)
@biqi1110 biqi1110 added the bug Something isn't working label Mar 7, 2022
@leoleojie leoleojie self-assigned this Mar 7, 2022
@leoleojie
Copy link
Collaborator

@biqi1110 您好,我们在 #1177 中修复了这个问题,感谢您的支持与反馈!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants