From 6503b23298dee8ec9303555c179029fe71fae958 Mon Sep 17 00:00:00 2001 From: 123malin Date: Wed, 10 Jun 2020 11:03:26 +0800 Subject: [PATCH] add aistudio link (#60) Co-authored-by: tangwei12 --- README.md | 2 +- models/demo/movie_recommand/rank/model.py | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a34e9eda..b326d4c5 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ python -m paddlerec.run -m paddlerec.models.rank.dnn * [分布式深度学习介绍](doc/ps_background.md) ### 快速开始 -* [十分钟上手PaddleRec](doc/quick_start.md) +* [十分钟上手PaddleRec](https://aistudio.baidu.com/aistudio/projectdetail/523965) ### 入门教程 * [数据准备](doc/slot_reader.md) diff --git a/models/demo/movie_recommand/rank/model.py b/models/demo/movie_recommand/rank/model.py index 6e6e4274..45a6faa0 100644 --- a/models/demo/movie_recommand/rank/model.py +++ b/models/demo/movie_recommand/rank/model.py @@ -69,14 +69,11 @@ class Model(ModelBase): map(embedding_layer, self.user_sparse_inputs)) mov_sparse_embed_seq = list( map(embedding_layer, self.mov_sparse_inputs)) - concated_user = fluid.layers.concat(user_sparse_embed_seq, axis=1) - concated_mov = fluid.layers.concat(mov_sparse_embed_seq, axis=1) + concated = fluid.layers.concat( + user_sparse_embed_seq + mov_sparse_embed_seq, axis=1) - usr_combined_features = fc(concated_user) - mov_combined_features = fc(concated_mov) + fc_input = fc(concated) - fc_input = fluid.layers.concat( - [usr_combined_features, mov_combined_features], axis=1) sim = fluid.layers.fc( input=fc_input, size=1, @@ -92,8 +89,6 @@ class Model(ModelBase): # slide_steps=20) if is_infer: - self._infer_results["user_feature"] = usr_combined_features - self._infer_results["movie_feature"] = mov_combined_features self._infer_results["uid"] = self._sparse_data_var[2] self._infer_results["movieid"] = self._sparse_data_var[6] self._infer_results["label"] = self._sparse_data_var[-1] -- GitLab