convolution in tensorflow (tf.nn.conv)

Understanding convolution in tensorflow

Points should be noticed

The convolution ops sweep a 2-D filter over a batch of images, applying the filter to each window of each image of the appropriate size. The different ops trade off between generic vs. specific filters:
conv2d: Arbitrary filters that can mix channels together.
depthwise_conv2d: Filters that operate on each channel independently.
separable_conv2d: A depthwise spatial filter followed by a pointwise
filter.

from:
Neural Network | TensorFlow
https://www.tensorflow.org/api_guides/python/nn#Convolution

Explanation of the equation in API of tf.nn.conv2d

这里写图片描述

b in yellow shadow is for travering through the batch with images.
the variables in green shadow is for locating a patch.
In the equation, di and dj loop variable to traverse through the height and width of the patch in one image.
~~I’m not very sure about this.
q is for traversing through the channels of the image, with the step of strike[3]. ~~

ref:
tf.nn.conv2d | TensorFlow
https://www.tensorflow.org/api_docs/python/tf/nn/conv2d

tf.nn.conv[1d, 2d, 3d]

There are tf.nn.conv1d, tf.nn.conv2d and tf.nn.conv3d. Problems are there, which to be choosed and what’s the difference.
I have not studied this deep. For I am using tensorflow to processing images, it seems tf.nn.conv2d is for me. From my perspective, the difference of them are as following.

  • tf.nn.conv1d is for some linear structure, text, sound or some others.
  • tf.nn.conv2d is for structure appeared to be 2-D, such as image.
  • tf.nn.conv3d is for something not familiar to me. It seems to be applied in signal processing.

posted on   yusisc  阅读(22)  评论(0编辑  收藏  举报

编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示