【发布时间】:2019-05-18 01:46:41
【问题描述】:
我阅读了What is the difference between 'SAME' and 'VALID' padding in tf.nn.max_pool of tensorflow?,但这不适用于我的实验。
import tensorflow as tf
inputs = tf.random_normal([1, 64, 64, 3])
print(inputs.shape)
conv = tf.keras.layers.Conv2D(6, 4, strides=2, padding='same')
outputs = conv(inputs)
print(outputs.shape)
生产
(1, 64, 64, 3)
(1, 32, 32, 6)
。然而,按照上面的链接会产生(1, 31, 31, 6),因为没有任何超出过滤器范围的额外值没有任何填充。
tf.keras.layers.Conv2D 与 padding='same' 和 strides > 1 的行为如何?
我想知道确切的答案及其证据。
【问题讨论】:
标签: python tensorflow conv-neural-network