From a3be0848b7502cf36c471ff4405d2490c3a4e203 Mon Sep 17 00:00:00 2001 From: Qdriving <35327911+Qdriving@users.noreply.github.com> Date: Mon, 28 Sep 2020 14:55:08 +0800 Subject: [PATCH] Update model.py yapf checked --- models/rank/dien/model.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/models/rank/dien/model.py b/models/rank/dien/model.py index ee39ff93..0a2d1c7f 100755 --- a/models/rank/dien/model.py +++ b/models/rank/dien/model.py @@ -248,17 +248,18 @@ class Model(ModelBase): keep_dim=True) test_neg = fluid.layers.reduce_sum( - fluid.layers.log( - fluid.layers.sigmoid( - fluid.layers.reduce_sum( - gru_out_pad[:, start_value:seq_shape[1] - 1, :] - * neg_seq_pad[:, start_value + 1:seq_shape[ - 1], :], - dim=2, - keep_dim=True))), - dim=2), - dim=1, - keep_dim=True) + fluid.layers.reduce_sum( + fluid.layers.log( + fluid.layers.sigmoid( + fluid.layers.reduce_sum( + gru_out_pad[:, start_value:seq_shape[1] - 1, :] + * neg_seq_pad[:, start_value + 1:seq_shape[ + 1], :], + dim=2, + keep_dim=True))), + dim=2), + dim=1, + keep_dim=True) aux_loss = fluid.layers.mean(test_neg + test_pos) -- GitLab