# def max_pool2d(inputs,
# kernel_size,
# stride=2,
# padding='VALID',
# data_format=DATA_FORMAT_NHWC,
# outputs_collections=None,
# scope=None): #"VALID"模式下
#输出图像大小 out_height = round((in_height - floor(filter_height / 2) * 2) / strides_height) floor表示下取整 round表示四舍五入 input = tf.Variable(tf.round(10 * tf.random_normal([1, 7, 7, 1])))
#filter = tf.Variable(tf.round(5 * tf.random_normal([3, 3, 1, 1])))
#op2 = tf.nn.conv2d(input, filter, strides=[1, 1, 1, 1], padding='VALID')
slim_max_pool2d = slim.max_pool2d(input, [3, 3], [1, 1], scope='pool1')
#slim_conv2d_SAME = slim.conv2d(input, 1, [3, 3], [1, 1], weights_initializer=tf.ones_initializer, padding='SAME')
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
slim_max_pool2d_value = \
sess.run(slim_max_pool2d)
print(slim_max_pool2d_value.shape)

TensorFlow基础笔记(11) max_pool2D函数的更多相关文章

  1. TensorFlow基础笔记(11) conv2D函数

    #链接:http://www.jianshu.com/p/a70c1d931395 import tensorflow as tf import tensorflow.contrib.slim as ...

  2. TensorFlow基础笔记(0) 参考资源学习文档

    1 官方文档 https://www.tensorflow.org/api_docs/ 2 极客学院中文文档 http://www.tensorfly.cn/tfdoc/api_docs/python ...

  3. TensorFlow基础笔记(3) cifar10 分类学习

    TensorFlow基础笔记(3) cifar10 分类学习 CIFAR-10 is a common benchmark in machine learning for image recognit ...

  4. Tensorflow基础笔记

    1.Keras是一个由Python编写的开源人工神经网络库. 2.深度学习主要应用在三个大的方向,计算机视觉,自然语言处理,强化学习 3.计算机视觉主要有:图片识别,目标检测,语义分割,视频理解(行为 ...

  5. TensorFlow基础1:reduce_sum()函数和reduce_mean()函数

    https://blog.csdn.net/chengshuhao1991/article/details/78545723 在计算损失时,通常会用到reduce_sum()函数来进行求和,但是在使用 ...

  6. TensorFlow基础笔记(15) 编译TensorFlow.so,提供给C++平台调用

    参考 http://blog.csdn.net/rockingdingo/article/details/75452711 https://www.cnblogs.com/hrlnw/p/700764 ...

  7. TensorFlow基础笔记(0) tensorflow的基本数据类型操作

    import numpy as np import tensorflow as tf #build a graph print("build a graph") #生产变量tens ...

  8. TensorFlow基础笔记(14) 网络模型的保存与恢复_mnist数据实例

    http://blog.csdn.net/huachao1001/article/details/78502910 http://blog.csdn.net/u014432647/article/de ...

  9. TensorFlow基础笔记(8) TensorFlow简单人脸识别

    数据材料 这是一个小型的人脸数据库,一共有40个人,每个人有10张照片作为样本数据.这些图片都是黑白照片,意味着这些图片都只有灰度0-255,没有rgb三通道.于是我们需要对这张大图片切分成一个个的小 ...

随机推荐

  1. HIVE HBASE 整合

    一直想将hbase 与hive整合在一起,因为公司项目工期一期紧似一期,故一直推后.还不知道推到什么时候呢. 今天尝试编译hive,看着官方文档.感觉非常easy: 1.svn co http://s ...

  2. js判断字符是否为空的方法

    js判断字符是否为空的方法: //判断字符是否为空的方法 function isEmpty(obj){ if(typeof obj == "undefined" || obj == ...

  3. mysql-cluster 环境安装&配置

    一.mysql-cluster 的介绍: 1.说心里话mysql-cluster这货性能上是不行的,之前一个同事测试了来的结果是8个主机组成的mysql-cluster性能 上搞不过一个单机的mysq ...

  4. jetty上传文件的时候报错显示文件过大

    这个时候我们需要修改jetty的参数文件 cd /data/java_web_app/news23456/etc vim jetty.xml 找到这一行 <Configure id=" ...

  5. Codeforces Round #262 (Div. 2) C

    题目: C. Present time limit per test 2 seconds memory limit per test 256 megabytes input standard inpu ...

  6. 【Android】17.5 利用Messenger实现进程间通信(IPC)

    分类:C#.Android.VS2015: 创建日期:2016-03-03 一.Messager类简介 本章前面曾经说过,要在Android上执行带服务的进程间通信(IPC),既可以用Messenge ...

  7. date 修改系统时间

    # date -s "2017/03/27 12:33:58"

  8. 关于locate这个NB命令我不得不深入的学习

    先看看locate的安装包和生成的文件: [root@NB mlocate]# which locate /usr/bin/locate [root@NB mlocate]# rpm -qf /usr ...

  9. mogoose的bug之不能根据类型为number的字段查找数据

    Users.find({paw:6868}).exec() //返回的结果为空 Users.find({paw:"6868"}).exec() //返回的结果也为空 Users.f ...

  10. python切片 []取值操作符

    切片1.什么叫切片数组,元组等含有多个元素的集合,取其中的一段元素的操作,叫做切片 2.取前10个元素 l = list(range(100)) l3 = l[:10] print(l3) 运行结果: ...