From 8ab55e00498ee1adab8f0cf61f6a6f9a9fce3b45 Mon Sep 17 00:00:00 2001 From: caoying03 Date: Wed, 8 Nov 2017 14:14:50 +0800 Subject: [PATCH] fix a bug of NCE prediction. --- nce_cost/network_conf.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nce_cost/network_conf.py b/nce_cost/network_conf.py index f226bc99..e7bb1796 100644 --- a/nce_cost/network_conf.py +++ b/nce_cost/network_conf.py @@ -33,7 +33,6 @@ def ngram_lm(hidden_size, emb_size, dict_size, gram_num=4, is_train=True): num_classes=dict_size, param_attr=paddle.attr.Param(name="nce_w"), bias_attr=paddle.attr.Param(name="nce_b"), - act=paddle.activation.Sigmoid(), num_neg_samples=25, neg_distribution=None) else: @@ -41,7 +40,7 @@ def ngram_lm(hidden_size, emb_size, dict_size, gram_num=4, is_train=True): size=dict_size, input=paddle.layer.trans_full_matrix_projection( hidden_layer, param_attr=paddle.attr.Param(name="nce_w")), - act=paddle.activation.Sigmoid(), + act=paddle.activation.Softmax(), bias_attr=paddle.attr.Param(name="nce_b")) -- GitLab