【问题标题】:Tensorflow tf.layers.conv3d output shapeTensorflow tf.layers.conv3d 输出形状
【发布时间】:2019-07-04 20:10:07
【问题描述】:

我有一个关于 tf.layers.conv3d 的问题。 如果我理解正确,它需要输入形状

(批次 x 深度 x 高度 x 宽度 x 通道)

通道应该只有一个;并给定一个过滤器(深度x高度x宽度),它创建#filters相同形状的不同过滤器以创建#filters输出通道并将它们与输入进行卷积以获得形状的输出

(批次 x out_depth x out_height x out_width x num_filters)

首先,我现在是吗? 问题是:在我看来,这一层不遵守卷积层的输入、输出、过滤器和步幅形状的约束规则,应该是:

(W-F+2P)/S+1

here 所述。相反,输出深度宽度和高度始终与输入相同。怎么了?感谢您的帮助!

【问题讨论】:

  • 如果你使用padding='same'会发生这种情况
  • 请说明具体的输入、内核和输出大小,以及传递给conv3d 的padding、stride 和dilation 选项。您发布的公式是正确的,但可能不清楚每个参数的精确值是多少(此外,如果您使用它,它不包括膨胀)。顺便说一句,输入端可以有多个通道,不需要固定为一个。

标签: python tensorflow conv-neural-network convolution


【解决方案1】:
kinda true but if input shape, filter shape and strides:
[Batch, depth, height, width, channels]
[filter_depth,filter_height,filter_width,in_channels,out_channels]
[1,s1,s2,s3,1]

output shape
[Batch,int(depth/s1),int(height/s2),int(width/s3),out_channels]

tf.layers.conv3d 是 tf.layers.convolution 的特例

了解填充算法: https://www.tensorflow.org/api_guides/python/nn#Convolution

为了理解卷积操作: https://www.tensorflow.org/api_docs/python/tf/nn/convolution

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-30
    • 2021-01-26
    • 1970-01-01
    • 2018-08-23
    • 2021-10-21
    • 1970-01-01
    相关资源
    最近更新 更多