如何自定义卷积操作?
我想使用2x2滤波器在Tensorflow中执行自定义卷积操作。操作就像我们有一个过滤器有2个通道[[[1,2],[3,4]],[[5,6],[7,8]]
和图像就像在2个频道中一样[[[1,2],[3,4]],[[5,6],[7,8]]
输出应该像>输出= [[26,40],[58,80]
。这是因为输出[0] [0] = 1 * 1 + 5 * 5,输出[0] [1] = 2 * 2 + 5 * 5,输出[1] [0] = 3 * 3 + 7 * 7,输出[1] [1] = 4 * 4 + 8 * 8
。基本上,我们在这里正在做的是,我们正在将图像的权重和一行和列中的通道的权重乘,然后加起来像1x1卷积。
I want to perform a customize convolution operation in tensorflow using a 2x2 filter. The operation is like if we have a filter having 2 channels [[[1,2],[3,4]],[[5,6],[7,8]]]
and the image is like in 2 channels [[[1,2],[3,4]],[[5,6],[7,8]]]
the output should be like output = [[26,40],[58,80]]
. This is output because output[0][0] = 1 * 1 + 5 * 5, output[0][1]=2 * 2 + 5 * 5, output[1][0]=3 * 3 + 7 * 7, output[1][1]= 4 * 4 + 8 * 8
. Basically what we are doing here is we are multiplying the weights of image and weights of channel in one row and column and then adding up something like 1x1 convolution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论