文档是这么写的:

    border_mode: str, int or tuple of two int
Either of the following: ``'valid'``: apply filter wherever it completely overlaps with the
input. Generates output of shape: input shape - filter shape + 1
``'full'``: apply filter wherever it partly overlaps with the input.
Generates output of shape: input shape + filter shape - 1
``'half'``: pad input with a symmetric border of ``filter rows // 2``
rows and ``filter columns // 2`` columns, then perform a valid
convolution. For filters with an odd number of rows and columns, this
leads to the output shape being equal to the input shape.
``int``: pad input with a symmetric border of zeros of the given
width, then perform a valid convolution.
``(int1, int2)``: pad input with a symmetric border of ``int1`` rows
and ``int2`` columns, then perform a valid convolution.

首先, 这几种模式对应的padding都是zero-padding.

  • int, (int1, int2): 它们最容易理解的: 手动指定行和列方向上的padding数量.
  • valid: 其实就是不padding, 即\(border\_mode = (0, 0)\)

  • full: 它的padding为:\(border\_mode=(k_h-1, k_w-1)\), 其中\(k\)为kernel的行数(高)与列数(宽). 若\(k_h=k_w=3\), conv操作会全方位覆盖所有的\((3, 3)\), \((3, 1)\), \((2,1)\), \((1, 1)\)区域. 这也是它叫full的原因.

  • half: \(border\_mode = (\frac {(k-1)}{2}, \frac{k-1}{2})\). 注意, \(k\)一般都是奇数. full模式的padding得到的conv输出比输入要大, 而half的输出形状与输入相同. 也有叫same的.


* 原始图片来源: https://github.com/vdumoulin/conv_arithmetic
* Reference: http://deeplearning.net/software/theano_versions/dev/tutorial/conv_arithmetic.html

Theano conv2d的border_mode的更多相关文章

  1. Deconvolution Using Theano

    Transposed Convolution, 也叫Fractional Strided Convolution, 或者流行的(错误)称谓: 反卷积, Deconvolution. 定义请参考tuto ...

  2. Theano2.1.15-基础知识之theano如何处理shapre信息

    来自:http://deeplearning.net/software/theano/tutorial/shape_info.html How Shape Information is Handled ...

  3. 基于theano的深度卷积神经网络

    使用了两个卷积层.一个全连接层和一个softmax分类器. 在测试数据集上正确率可以达到99.22%. 代码参考了neural-networks-and-deep-learning #coding:u ...

  4. theano中对图像进行convolution 运算

    (1) 定义计算过程中需要的symbolic expression """ 定义相关的symbolic experssion """ # c ...

  5. theano中的concolutional_mlp.py学习

    (1) evaluate _lenet5中的导入数据部分 # 导入数据集,该函数定义在logistic_sgd中,返回的是一个list datasets = load_data(dataset) # ...

  6. Keras:基于Theano和TensorFlow的深度学习库

    catalogue . 引言 . 一些基本概念 . Sequential模型 . 泛型模型 . 常用层 . 卷积层 . 池化层 . 递归层Recurrent . 嵌入层 Embedding 1. 引言 ...

  7. Summary on deep learning framework --- Theano && Lasagne

     Summary on deep learning framework --- Theano && Lasagne 2017-03-23 1. theano.function outp ...

  8. 深度学习框架caffe/CNTK/Tensorflow/Theano/Torch的对比

    在单GPU下,所有这些工具集都调用cuDNN,因此只要外层的计算或者内存分配差异不大其性能表现都差不多. Caffe: 1)主流工业级深度学习工具,具有出色的卷积神经网络实现.在计算机视觉领域Caff ...

  9. theano使用

    一  theano内置数据类型 只有thenao.shared()类型才有get_value()成员函数(返回numpy.ndarray)? 1. 惯常处理 x = T.matrix('x') # t ...

随机推荐

  1. WCF学习系列二---【WCF Interview Questions – Part 2 翻译系列】

    http://www.topwcftutorials.net/2012/09/wcf-faqs-part2.html WCF Interview Questions – Part 2 This WCF ...

  2. 物联网框架ServerSuperIO(SSIO)更新、以及增加宿主程序和配置工具,详细介绍

    一.更新内容 1.修改*Server类,以及承继关系.2.增加IRunDevice的IServerProvider接口继承.3.修复增加COM设备驱动可能造成的异常.4.修复网络发送数据可能引发的异常 ...

  3. Maven+Spring+Spring MVC+MyBatis+MySQL,搭建SSM框架环境【转】

    项目建设完成之后的结构: 数据库的表结构如下: 环境建设:搭建Maven环境.Tomcat环境.需要MySql 数据库支持,使用的编程工具Eclipse (这些是前期准备): 开始创建工程: 1.创建 ...

  4. IIS7 应用程序池自动回收关闭的解决方案

    在ASP.NET Application中加入某个定时任务,那想必一定是用一个线程在不停地做定时计算,在自己的ASP.NET应用程序中加入了Quartz.NET框架 夜间或者网站在经过无访问阶段后,后 ...

  5. 自定义UITabBarController标签视图控制器

    首先创建一个类,继承自UItabBarController 然后在.m文件中: 这里我有两个宏定义: #define WIDTH (myView.frame.size.width / 4) //我在写 ...

  6. 时间戳TimeStamp处理

     我获得这个时间戳是得想除以1000再处理的,看看你们的需要先除多少再处理 //时间戳处理 NSInteger time = timeStamp / 1000; NSNumber *timer = [ ...

  7. Android中通信协议

    一.TCP/IP协议(传输层协议) 1.Socket与ServerSocket Socket是应用层与TCP/IP协议簇通讯的中间抽象层,Socket是一组接口,在设计模式中,Socket的设计就是门 ...

  8. 了解JavaScript 对象属性的标签

    对象属性的标签 value(属性值), writable(属性可写), enumerable(属性可枚举), configurable(属性可配置), 这些属性标签使对象所持有的属性体现出不同的特性, ...

  9. android:使用Messenger进行进程间通信(一)

    Messenger简介 Messenger和AIDL是实现进程间通信(interprocess communication)的两种方式. 实际上,Messenger的实现其实是对AIDL的封装. Me ...

  10. nginx启动、关闭、重启

    1.启动 [root@localhost local]# nginx/sbin/nginx #启动 [root@localhost local]# nginx/sbin/nginx -t #检查配置文 ...