tf.nn.conv2d(input, filter, strides, padding, use_cudnn_on_gpu=None, name=None)

  • input:
    指需要做卷积的输入图像,它要求是一个Tensor,具有[batch, in_height, in_width,
    in_channels]这样的shape,具体含义是[训练时一个batch的图片数量, 图片高度, 图片宽度,
    图像通道数],注意这是一个4维的Tensor,要求类型为float32和float64其中之一

  • filter:
    相当于CNN中的卷积核,它要求是一个Tensor,具有[filter_height, filter_width, in_channels,
    out_channels]这样的shape,具体含义是[卷积核的高度,卷积核的宽度,图像通道数,卷积核个数],要求类型与参数input相同,有一个地方需要注意,第三维in_channels,就是参数input的第四维

  • strides:卷积时在图像每一维的步长,这是一个一维的向量,长度4

  • padding:
    string类型的量,只能是”SAME”,”VALID”其中之一,这个值决定了不同的卷积方式(后面会介绍)

  • use_cudnn_on_gpu:
    bool类型,是否使用cudnn加速,默认为true

结果返回一个Tensor,这个输出,就是我们常说的feature map

name是啥?

strides[1,1,1,1]和strides[1,2,2,1]啥关系?

input = tf.Variable(tf.random_normal([1,5,5,5]))
filter = tf.Variable(tf.random_normal([3,3,5,7])) op = tf.nn.conv2d(input, filter, strides=[1, 1, 1, 1], padding='SAME')

此时输出7张5×5的feature map


input = tf.Variable(tf.random_normal([1,5,5,5]))
filter = tf.Variable(tf.random_normal([3,3,5,7])) op = tf.nn.conv2d(input, filter, strides=[1, 2, 2, 1], padding='SAME')
此时,输出7张3×3的feature map

http://blog.csdn.net/mao_xiao_feng/article/details/78004522


 

tf.nn.conv2d的更多相关文章

  1. TF-卷积函数 tf.nn.conv2d 介绍

    转自 http://www.cnblogs.com/welhzh/p/6607581.html 下面是这位博主自己的翻译加上测试心得 tf.nn.conv2d是TensorFlow里面实现卷积的函数, ...

  2. tf.nn.conv2d 和 tf.nn.max_pool 中 padding 分别为 'VALID' 和 'SAME' 的直觉上的经验和测试代码

    这个地方一开始是迷糊的,写代码做比较分析,总结出直觉上的经验. 某人若想看精准的解释,移步这个网址(http://blog.csdn.net/fireflychh/article/details/73 ...

  3. tf.nn.conv2d。卷积函数

    tf.nn.conv2d是TensorFlow里面实现卷积的函数,参考文档对它的介绍并不是很详细,实际上这是搭建卷积神经网络比较核心的一个方法,非常重要 tf.nn.conv2d(input, fil ...

  4. 深度学习原理与框架-Tensorflow卷积神经网络-卷积神经网络mnist分类 1.tf.nn.conv2d(卷积操作) 2.tf.nn.max_pool(最大池化操作) 3.tf.nn.dropout(执行dropout操作) 4.tf.nn.softmax_cross_entropy_with_logits(交叉熵损失) 5.tf.truncated_normal(两个标准差内的正态分布)

    1. tf.nn.conv2d(x, w, strides=[1, 1, 1, 1], padding='SAME')  # 对数据进行卷积操作 参数说明:x表示输入数据,w表示卷积核, stride ...

  5. tf.nn.conv2d 参数介绍

    tf.nn.conv2d是TensorFlow里面实现卷积的函数,参考文档对它的介绍并不是很详细,实际上这是搭建卷积神经网络比较核心的一个方法,非常重要 tf.nn.conv2d(input, fil ...

  6. tf.nn.conv2d()需要搞清楚的几个变量。

    惯例先展示函数: tf.nn.conv2d(input, filter, strides, padding, use_cudnn_on_gpu=None, name=None) 除去name参数用以指 ...

  7. tf入门-tf.nn.conv2d是怎样实现卷积的?

    转自:https://blog.csdn.net/mao_xiao_feng/article/details/78004522 实验环境:tensorflow版本1.2.0,python2.7 介绍 ...

  8. tf.nn.conv2d实现卷积的过程

    #coding=utf-8 import tensorflow as tf #case 2 input = tf.Variable(tf.round(10 * tf.random_normal([1, ...

  9. 【TensorFlow】tf.nn.conv2d是怎样实现卷积的?

    tf.nn.conv2d是TensorFlow里面实现卷积的函数,参考文档对它的介绍并不是很详细,实际上这是搭建卷积神经网络比较核心的一个方法,非常重要 tf.nn.conv2d(input, fil ...

随机推荐

  1. 雷林鹏分享:C# 字符串(String)

    C# 字符串(String) 在 C# 中,您可以使用字符数组来表示字符串,但是,更常见的做法是使用 string 关键字来声明一个字符串变量.string 关键字是 System.String 类的 ...

  2. 单分子荧光原位杂交(smFISH)

    single-molecule RNA fluorescence in situ hybridization (RNA smFISH) 单分子荧光原位杂交(smFISH)是一种新的基因表达分析方法,能 ...

  3. zookeeper在搭建的时候,解决后台启动为standalone模式问题

    今天在搭建zookeeper,搭建完成之后,启动一直报错: 上网查了好多资料:有几种解决方案: 1.在配置文件conf目录下,将zoo_sample.cfg删除,只留zoo.cfg(然而就我的情况而言 ...

  4. Hibernate多对多单向关联和双向关联 --Hibernate框架

    Hibernate关联关系中相对比较特殊的就是多对多关联,多对多关联与一对一关联和一对多关联不同,多对多关联需要另外一张映射表用于保存多对多映射信息.本例介绍多对多单向关联和双向关联.单向关联 :指具 ...

  5. patch-test-and-proc

    实验环境 Ubuntu 14.04.5 LTS Linux - 4.15.6 为单个文件进程补丁操作 在桌面 Desktop 建立文件夹 patch ,作为实验用,然后进入patch 文件夹.建立测试 ...

  6. Django分页器和自定义分页器

    一.自定义分页器 import copy class Pagination(): def __init__(self,request,current_page,all_data_num,each_pa ...

  7. 小程序模板中data传值有无...

    A:<template is="gemSelectColor" data="{{optionData}}" />B:<template is= ...

  8. jquery快速获得url 的get传值

    <script> var res = location.search.substr(1).split("&"); var arr={}; for (var i ...

  9. Plus One leetcode java

    问题描述: Given a non-negative number represented as an array of digits, plus one to the number. The dig ...

  10. springBoot配置,贴个图

    spring: datasource: name: test url: jdbc:mysql://localhost:3306/epay?characterEncoding=UTF-8 usernam ...