-
Notifications
You must be signed in to change notification settings - Fork 706
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
[DIN] models/din.py 的第 94~97行是否有点问题 #176
Comments
从din.py的第94行开始 sequence_embed_dict实际得到的是经过Embedding后输出的Tensor组成的dict,然后作get_varlen_polling_list的第一个参数传入;但是get_varlen_polling_list的第一个参数应该是一个放着Embedding Layer的dict... |
感谢您细致地排查问题,我们会在近期的版本中对该问题进行修复,祝好! 代码逻辑是有问题的,get_varlen_pooling_list()两次调用的入参类型不一致。 第一次调用: DeepCTR-Torch/deepctr_torch/models/din.py Line 84 in 8265c75
self.input_from_feature_columns()里调用了get_varlen_pooling_list()。这时第一个输入embedding_dict的value为embed layer。 第二次调用: DeepCTR-Torch/deepctr_torch/models/din.py Lines 94 to 99 in 8265c75
处理非hist feat类变长特征时,也会调用get_varlen_pooling_list()。这时第一个输入参数embedding_dict的value为tensor。而get_varlen_pooling_list()中做pooling之前会根据index取embedding,相当于取了两次index,所以当使用了非hist类VarLenSparseFeat时,就会报错。(但由于例子run_din.py中的VarLenSparseFeat均为hist类特征,所以该bug一直未被发现。) |
是代码写错了吗? 运行的是examples/run_din.py。
The text was updated successfully, but these errors were encountered: