池化函数-max_pool_with_argmax

来源:互联网 发布:python 绘制分布图 编辑:程序博客网 时间:2024/06/06 01:23
import tensorflow as tfimport numpy as npinput_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~


原创粉丝点击