池化函数-max_pool_with_argmax

import tensorflow as tf
import numpy as np


input_data = tf.Variable( np.random.rand(10, 6, 6 ,3), dtype = np.float32 )
filter_data = tf.Variable( np.random.rand(2, 2, 3, 10), dtype = np.float32)
y = tf.nn.conv2d(input_data, filter_data, strides = [1, 1, 1, 1], padding = 'SAME')
output,argmax = tf.nn.max_pool_with_argmax(input = y, ksize = [1, 2, 2, 1], strides = [1, 1, 1, 1], padding = 'SAME')

with tf.Session() as sess:
    sess.run(tf.global_variables_initializer())
    print sess.run(argmax)
    print sess.run(tf.shape(argmax))



GPU ONLY~


你可能感兴趣的:(TFBoy)