根据这个深度学习课程http://cs231n.github.io/convolutional-networks/#conv,它说如果有x形状[W,W](其中W = width = height)的输入通过具有过滤器形状和步幅的卷积层,该层将返回一个形状[F,F] Soutput[(W-F)/S +1, (W-F)/S +1]
但是,当我尝试按照 Tensorflow 的教程进行操作时:https ://www.tensorflow.org/versions/r0.11/tutorials/mnist/pros/index.html 。功能好像有区别tf.nn.conv2d(inputs, filter, stride)
无论我如何更改过滤器大小,conv2d都会不断返回一个与输入具有相同形状的值。
就我而言,我使用的MNIST数据集表明每个图像都有大小[28,28](忽略channel_num = 1)
但是在我定义了第一conv1层之后,我用conv1.get_shape()来查看它的输出,它给了我[28,28, num_of_filters]
为什么是这样?我认为返回值应该遵循上面的公式。
附录:代码片段
#reshape x from 2d to 4d
x_image = tf.reshape(x, [-1, 28, 28, 1]) #[num_samples, width, height, channel_num]
## define the shape of …Run Code Online (Sandbox Code Playgroud) 例如,我正在运行一个Java程序。我可以使用python获取此Java程序的内容(屏幕截图)吗?不是全屏显示,只是Java程序。
我已经看过这个模块,但是它需要一个参数“程序窗口在哪里”:
import pyscreenshot as ImageGrab
if __name__ == "__main__":
# part of the screen
im=ImageGrab.grab(bbox=(10,10,510,510)) # X1,Y1,X2,Y2
im.show()
#-#
Run Code Online (Sandbox Code Playgroud)
但这可能不是我想要的,因为它需要bounding_box。