VALID SAME

区别SAME和VALID

VALID

input = tf.Variable(tf.random_normal([1,5,5,5]))  

filter = tf.Variable(tf.random_normal([3,3,5,1]))  

op = tf.nn.conv2d(input, filter, strides=[1, 1, 1, 1], padding='VALID')  

输出图形:

.....  
.xxx.  
.xxx.  
.xxx.  
..... 

SAME

input = tf.Variable(tf.random_normal([1,5,5,5]))  
filter = tf.Variable(tf.random_normal([3,3,5,1]))  

op = tf.nn.conv2d(input, filter, strides=[1, 1, 1, 1], padding='SAME') 
xxxxx  
xxxxx  
xxxxx  
xxxxx  
xxxxx  
posted @ 2022-08-19 22:58  luoganttcc  阅读(16)  评论(0编辑  收藏  举报