From a027cb59ad0ba91796801ade83261bd8b6588aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=82=96?= Date: Tue, 25 Feb 2020 18:06:32 +0800 Subject: [PATCH] fix a bug in pointwise mode of dygraph/similarity_net (#4339) * Update README.md (#4267) * test=develop (#4269) * 3d use new api (#4275) * PointNet++ and PointRCNN use new API * Update Readme of Dygraph BERT (#4277) Fix some typos. * Update run_classifier_multi_gpu.sh (#4279) remove the CUDA_VISIBLE_DEVICES * Update README.md (#4280) * add similarity_net dygraph * fix similarity_net dygraph * fix bugs of dygraph/similarity_net * Fix some bugs running on the GPU of dygraph/similarity_net * fix a bug in pointwise mode of dygraph/similarity_net Co-authored-by: pkpk Co-authored-by: Kaipeng Deng --- dygraph/similarity_net/nets/bow.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dygraph/similarity_net/nets/bow.py b/dygraph/similarity_net/nets/bow.py index b85b98e4..407125b0 100644 --- a/dygraph/similarity_net/nets/bow.py +++ b/dygraph/similarity_net/nets/bow.py @@ -39,6 +39,7 @@ class BOW(Layer): self.seq_len = conf_dict["seq_len"] self.emb_layer = layers.EmbeddingLayer(self.dict_size, self.emb_dim, "emb").ops() self.bow_layer = Linear(self.bow_dim, self.bow_dim) + self.bow_layer_po = layers.FCLayer(self.bow_dim, None, "fc").ops() self.softmax_layer = layers.FCLayer(2, "softmax", "cos_sim").ops() @@ -71,6 +72,6 @@ class BOW(Layer): else: concat_layer = layers.ConcatLayer(1) concat = concat_layer.ops([left_soft, right_soft]) - concat_fc = self.bow_layer(concat) + concat_fc = self.bow_layer_po(concat) pred = self.softmax_layer(concat_fc) return left_soft, pred -- GitLab