未验证 提交 5b431d86 编写于 作者: Q Qiao Longfei 提交者: GitHub

Merge pull request #1526 from jacquesqiao/fix-models-ctr-map

ctr support python 3
......@@ -78,7 +78,7 @@ def ctr_deepfm_model(factor_size, sparse_feature_dim, dense_feature_dim, sparse_
param_attr=sparse_fm_param_attr, is_sparse=True)
return fluid.layers.sequence_pool(input=emb, pool_type='average')
sparse_embed_seq = map(embedding_layer, sparse_input_ids)
sparse_embed_seq = list(map(embedding_layer, sparse_input_ids))
concated = fluid.layers.concat(sparse_embed_seq + [dense_input], axis=1)
fc1 = fluid.layers.fc(input=concated, size=400, act='relu',
param_attr=fluid.ParamAttr(initializer=fluid.initializer.Normal(
......@@ -134,7 +134,7 @@ def ctr_dnn_model(embedding_size, sparse_feature_dim):
use_double_buffer=True)
words = fluid.layers.read_file(py_reader)
sparse_embed_seq = map(embedding_layer, words[1:-1])
sparse_embed_seq = list(map(embedding_layer, words[1:-1]))
concated = fluid.layers.concat(sparse_embed_seq + words[0:1], axis=1)
fc1 = fluid.layers.fc(input=concated, size=400, act='relu',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册