Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于CNN的几个问题 #25

Open
shuaihuaiyi opened this issue May 16, 2018 · 3 comments
Open

关于CNN的几个问题 #25

shuaihuaiyi opened this issue May 16, 2018 · 3 comments

Comments

@shuaihuaiyi
Copy link
Contributor

1、3D卷积核的shape中,那个恒定为1的维度代表了什么呢?之前您使用tf.expand_dims将输入的维度增加了1,这两者有关吗?kernel_size中的那些参数是根据什么来进行排列的呢?
2、tf.contrib.layers.conv3d提供了默认参数activation_fn=tf.nn.relu, 为什么之后还要手动进行一次激活?
3、with语句中的最后一行scope.reuse_variables()有什么作用呢?执行完这条语句就会进入下一次循环,构造新的scope,我有点想不通

@shuaihuaiyi
Copy link
Contributor Author

另外很多论文里的CNN都是从两侧进行padding的(比如Named Entity Recognition with Bidirectional LSTM-CNNs和End-to-end Sequence Labeling via Bi-directional LSTM-CNNs-CRF)这个项目似乎是只从末尾进行padding,这种是无所谓的吗?

深度学习刚刚入门不久,问题比较多,麻烦您啦

@liu-nlper
Copy link
Owner

liu-nlper commented May 24, 2018 via email

@shuaihuaiyi
Copy link
Contributor Author

在官方文档只有这样的说明

kernel_size: A sequence of N positive integers specifying the spatial dimensions of the filters. Can be a single integer to specify the same value for all spatial dimensions.

我理解这里对单词的卷积是这样的:首先一个单词表示成字符向量的序列,shape应该是【单词里的字符数量,字符向量的维度】,卷积核的shape应该是【超参数指定的卷积核长度,字符向量的维度】。如果字符向量是列向量,那么卷积核应当只沿着行进行滑动,它覆盖了所有的列,所以不会在这一方向进行滑动。是不是没有必要加入channel呢?加入channel之后,现在输入单词的shape是【单词里的字符数量,字符向量的维度,通道数(1)】,而卷积核的shape是【通道数(1),超参数指定的卷积核长度,字符向量的维度】,为什么把通道数移到最前面了呢?在tf.nn.conv*d系列API里都是按顺序写的,而tf.contrib.layers.conv2d的API文档里只有上面的说明,所以有些不理解

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants