tensor shape depend on both strides and padding type
try strides in (1 1), (2 2), (3 3) and (4 4) combine with twice padding type
import os
import numpy as np
import tensorflow as tf
os.environ["CUDA_VISIBLE_DEVICES"] = "3"
n = tf.convert_to_tensor(np.array(range(16)), np.float32)
i = tf.reshape(n, [-1, 4, 4, 1])
conv = tf.layers.conv2d(inputs=i, filters=32, kernel_size=[1, 1], strides=(3, 3), padding="same", activation=tf.nn.relu)
print(conv)
本文通过使用TensorFlow实现了一个简单的卷积神经网络,并探讨了不同步长(strides)及填充(padding)设置对于输出张量形状的影响。实验中,作者尝试了多种组合,包括(1,1),(2,2),(3,3)和(4,4)的步长,并结合两种不同的填充类型,以此来观察这些变化如何影响最终的输出。
1145

被折叠的 条评论
为什么被折叠?



