Closed robinren03 closed 4 years ago
deepfm的实现有bug,计算linear_logit的时候修改了feature_column的embedding_dim,导致embedding matrix前后shape不一致
def get_linear_logit(features, feature_columns, units=1, use_bias=False, seed=1024, prefix='linear',
l2_reg=0):
linear_feature_columns = copy(feature_columns)
for i in range(len(linear_feature_columns)):
if isinstance(linear_feature_columns[i], SparseFeat):
linear_feature_columns[i] = linear_feature_columns[i]._replace(embedding_dim=1)
if isinstance(linear_feature_columns[i], VarLenSparseFeat):
linear_feature_columns[i] = linear_feature_columns[i]._replace(
sparsefeat=linear_feature_columns[i].sparsefeat._replace(embedding_dim=1))
在deepfm.py里把linear_logit去掉就可以运行了,linear层没有特征交叉,对深度模型本来贡献就很小
运行环境:
当执行python examples/run_classification_criteo.py 时,出现以下报错: 请问如何处理?