From 72c084b10c4f12d875cc1c88f9a6c14cafd0714c Mon Sep 17 00:00:00 2001 From: frankwhzhang Date: Sat, 12 Oct 2019 17:48:00 +0800 Subject: [PATCH] update model , test=develop --- PaddleRec/gru4rec/net.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PaddleRec/gru4rec/net.py b/PaddleRec/gru4rec/net.py index 7e9f65bb..f0496434 100644 --- a/PaddleRec/gru4rec/net.py +++ b/PaddleRec/gru4rec/net.py @@ -69,6 +69,8 @@ def train_bpr_network(vocab_size, neg_size, hid_size, drop_out=0.2): name="emb", initializer=fluid.initializer.XavierInitializer(), learning_rate=emb_lr_x)) + emb_src = fluid.layers.squeeze(input=emb_src, axes=[1]) + emb_src_drop = fluid.layers.dropout(emb_src, dropout_prob=drop_out) @@ -134,6 +136,7 @@ def train_cross_entropy_network(vocab_size, neg_size, hid_size, drop_out=0.2): name="emb", initializer=fluid.initializer.XavierInitializer(), learning_rate=emb_lr_x)) + emb_src = fluid.layers.squeeze(input=emb_src, axes=[1]) emb_src_drop = fluid.layers.dropout(emb_src, dropout_prob=drop_out) -- GitLab