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. 从fasta中提取或者过滤掉多个序列

    Google了一下,现成的工具不多. 自己写代码也可以,就是速度肯定不快,而且每次写也很麻烦. 偶然看到QIIME的filter_fasta.py有这个功能,从name list中提取多个序列. fi ...

  2. Linux文件系统管理

    第九讲 文件系统管理   基础知识点:   硬盘的构成:主要由盘片.机械手臂.磁头与主轴马达所组成,实际的数据都是写在具有磁性物质上的盘片,通过主轴马达让盘片转动,机械手臂可伸展让磁头在盘片上读取数据 ...

  3. 纯css实现顶部进度条随滚动条滚动

    <!DOCTYPE html> <head> <meta charset="utf-8"> <meta http-equiv=" ...

  4. python第三方库scrapy框架的安装

    1.确认python和pip安装成功 2.安装win32py          提供win32api,下载地址:https://sourceforge.net/projects/pywin32/fil ...

  5. PAT 1003 Emergency

    1003 Emergency (25 分)   As an emergency rescue team leader of a city, you are given a special map of ...

  6. tomcat从manager部署war项目上传失败

    tomcat从manager部署war项目上传失败, 查看manager.2018-07-17.log 日志,可以看到如下信息. less manager.2018-07-17.log 17-Jul- ...

  7. 利用NPOI解析Excel的通用类

    using System.Collections.Generic; using System.Data; using System.IO; using System.Linq; using NPOI. ...

  8. python 文件的打开与读取

    python 文件的打开与读取 其实网上其他人写的都挺好的,我也是看他们的.办公室用的2.7.笔记本用的3.6.发现没有file 类,尴尬了 with open(r'C:\Users\HBX\Docu ...

  9. Jackson 工具类使用及配置指南

    目录 前言 Jackson使用工具类 Jackson配置属性 Jackson解析JSON数据 Jackson序列化Java对象 前言 Json数据格式这两年发展的很快,其声称相对XML格式有很对好处: ...

  10. python http 请求 响应 post表单提交

    1. 查看请求 响应情况 print(response.text) print(response.headers) print(response.request.body) print(respons ...