From a08c0691a77623987a6b9193e29182127f467bf3 Mon Sep 17 00:00:00 2001 From: Qiao Longfei Date: Wed, 24 Oct 2018 13:33:15 +0800 Subject: [PATCH] optimize code --- fluid/recommendation/ctr/network_conf.py | 6 +----- fluid/recommendation/ctr/train.py | 1 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/fluid/recommendation/ctr/network_conf.py b/fluid/recommendation/ctr/network_conf.py index 81ccf8fc..027dde27 100644 --- a/fluid/recommendation/ctr/network_conf.py +++ b/fluid/recommendation/ctr/network_conf.py @@ -34,15 +34,11 @@ def ctr_dnn_model(embedding_size): label = fluid.layers.data(name='label', shape=[1], dtype='int64') - data_list = [dense_input] + sparse_input_ids - - + data_list = [dense_input] + sparse_input_ids + [label] cost = fluid.layers.cross_entropy(input=predict, label=label) avg_cost = fluid.layers.reduce_sum(cost) accuracy = fluid.layers.accuracy(input=predict, label=label) auc_var, batch_auc_var, auc_states = fluid.layers.auc(input=predict, label=label, num_thresholds=2**12, slide_steps=20) - data_list.append(label) - return avg_cost, data_list, auc_var, batch_auc_var diff --git a/fluid/recommendation/ctr/train.py b/fluid/recommendation/ctr/train.py index 038c3037..2030971f 100644 --- a/fluid/recommendation/ctr/train.py +++ b/fluid/recommendation/ctr/train.py @@ -1,4 +1,5 @@ from __future__ import print_function + import argparse import os import time -- GitLab