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

请教一下:assignment2/cs231n/classifier/cnn.py的第一个全连接层的输入维度为什么是F*H/2*W/2? #2

Closed
liferlisiqi opened this issue Apr 17, 2018 · 4 comments

Comments

@liferlisiqi
Copy link

源码在cnn.py的54行,多谢了

@Halfish
Copy link
Owner

Halfish commented Apr 20, 2018

这行吗?cnn.py L54

因为输入的维度是 C,H,W,经过一层卷积运算以后是 F,H,W,再经过 pooling 后变成了 F, H/2, W/2,把这些维度 flatten 成一维就行了。其中激活函数不改变维度,卷积核卷积也是做了 padding,不改变长和宽。

@liferlisiqi
Copy link
Author

@Halfish 对,就是这行。你说卷积后的维度是FxHxW,但是卷积维度的公式是(H-HH+2×pad)/stride+1,这里的pad和stride并没有给出啊,还是说不是按照这个公式算的,多谢了。

@Halfish
Copy link
Owner

Halfish commented Apr 26, 2018

79 行不是给了 pad 和 stride?

@liferlisiqi
Copy link
Author

奥,原来是从后向前推的

@Halfish Halfish closed this as completed Apr 27, 2018
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