diff --git a/fluid/PaddleRec/tagspace/cluster_train.py b/fluid/PaddleRec/tagspace/cluster_train.py index ee29bb3214145fec0b900e972ea7a5bb813cdd87..96cdf615ed9e6673159db5163f33f431d5c6e9bc 100644 --- a/fluid/PaddleRec/tagspace/cluster_train.py +++ b/fluid/PaddleRec/tagspace/cluster_train.py @@ -71,7 +71,7 @@ def train(): buffer_size=batch_size*100, is_train=True) """ train network """ # Train program - text, pos_tag, neg_tag, avg_cost, correct, cos_pos = net.network(vocab_text_size, vocab_tag_size, neg_size=neg_size) + avg_cost, correct, cos_pos = net.network(vocab_text_size, vocab_tag_size, neg_size=neg_size) # Optimization to minimize lost sgd_optimizer = fluid.optimizer.SGD(learning_rate=args.base_lr) diff --git a/fluid/PaddleRec/tagspace/net.py b/fluid/PaddleRec/tagspace/net.py index 20aa1a311c643e9a7502557a02e8a900468e96ca..cbafb1701c47a3c40d15ce118304c5ff3b8d7b9a 100644 --- a/fluid/PaddleRec/tagspace/net.py +++ b/fluid/PaddleRec/tagspace/net.py @@ -46,4 +46,4 @@ def network(vocab_text_size, vocab_tag_size, emb_dim=10, hid_dim=1000, win_size= avg_cost = nn.mean(loss_part3) less = tensor.cast(cf.less_than(cos_neg, cos_pos), dtype='float32') correct = nn.reduce_sum(less) - return text, pos_tag, neg_tag, avg_cost, correct, cos_pos + return avg_cost, correct, cos_pos \ No newline at end of file diff --git a/fluid/PaddleRec/tagspace/train.py b/fluid/PaddleRec/tagspace/train.py index 8b7bdf5d0b2e4346afffd6676936819048f5ebfd..69992154750dfdc3ed5e0b9433338a366d7cd3c7 100644 --- a/fluid/PaddleRec/tagspace/train.py +++ b/fluid/PaddleRec/tagspace/train.py @@ -64,7 +64,7 @@ def train(): buffer_size=batch_size*100, is_train=True) """ train network """ # Train program - text, pos_tag, neg_tag, avg_cost, correct, cos_pos = net.network(vocab_text_size, vocab_tag_size, neg_size=neg_size) + avg_cost, correct, cos_pos = net.network(vocab_text_size, vocab_tag_size, neg_size=neg_size) # Optimization to minimize lost sgd_optimizer = fluid.optimizer.Adagrad(learning_rate=args.base_lr)