提交 462a796a 编写于 作者: P peterzhang2029

refine the code in doc

上级 dde6178e
...@@ -131,7 +131,7 @@ def create_cnn(self, emb, prefix=''): ...@@ -131,7 +131,7 @@ def create_cnn(self, emb, prefix=''):
conv_3 = create_conv(3, self.dnn_dims[1], "cnn") conv_3 = create_conv(3, self.dnn_dims[1], "cnn")
conv_4 = create_conv(4, self.dnn_dims[1], "cnn") conv_4 = create_conv(4, self.dnn_dims[1], "cnn")
return conv_3, conv_4 return paddle.layer.concat(input=[conv_3, conv_4])
``` ```
CNN 接受词向量序列,通过卷积和池化操作捕捉到原始句子的关键信息,最终输出一个语义向量(可以认为是句子向量)。 CNN 接受词向量序列,通过卷积和池化操作捕捉到原始句子的关键信息,最终输出一个语义向量(可以认为是句子向量)。
......
...@@ -107,7 +107,7 @@ def create_cnn(self, emb, prefix=''): ...@@ -107,7 +107,7 @@ def create_cnn(self, emb, prefix=''):
conv_3 = create_conv(3, self.dnn_dims[1], "cnn") conv_3 = create_conv(3, self.dnn_dims[1], "cnn")
conv_4 = create_conv(4, self.dnn_dims[1], "cnn") conv_4 = create_conv(4, self.dnn_dims[1], "cnn")
return conv_3, conv_4 return paddle.layer.concat(input=[conv_3, conv_4])
``` ```
CNN accepts the word sequence of the embedding table, then process the data by convolution and pooling, and finally outputs a semantic vector. CNN accepts the word sequence of the embedding table, then process the data by convolution and pooling, and finally outputs a semantic vector.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册