【问题标题】:What is the exact meaning of stride's list in tf.nn.conv2d? [duplicate]tf.nn.conv2d中stride列表的确切含义是什么? [复制]
【发布时间】:2019-02-05 20:47:02
【问题描述】:
conv2d( input, filter, strides, padding, use_cudnn_on_gpu=None, data_format=None, name=None)
strides=[b,h,w,c]

我知道b 表示batchh 表示heightw 表示widthc 表示channel。我看到bc 总是1。如果b = 2c = 2 是什么意思?

【问题讨论】:

    标签: tensorflow


    【解决方案1】:

    Stride 是您要在特定方向上跳过的数量。您的每个批次都是 4 维的 (batch_size, height, width, channels)。但是,你知道计算不应该跳过任何batch,也不应该跳过任何channel,但GPU看到的只是一个4D张量,因此在每个维度上都需要stride

    tf.nn.conv2d 是 Tensorflow 中的低级实现,它按原样公开了 GPU API。还有另一个高级实现,tf.layers.Conv2d,它只允许你传递两个元素的元组,height stridewidth stride。但是,如果您想使用低级 API(可能是由于对参数的更多控制),您应该始终将批处理和列步长保持为 1。

    【讨论】:

      猜你喜欢
      • 2010-11-05
      • 1970-01-01
      • 2011-12-14
      • 1970-01-01
      • 2014-03-24
      • 1970-01-01
      • 2017-04-19
      • 2011-05-06
      相关资源
      最近更新 更多