文档是这么写的:

    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. Java三大框架之——Hibernate关联映射与级联操作

    什么是Hibernate中的关联映射? 简单来说Hibernate是ORM映射的持久层框架,全称是(Object Relational Mapping),即对象关系映射. 它将数据库中的表映射成对应的 ...

  2. position总结图

  3. C# Session添加、删除封装类

    /// <summary> /// <para> </para> /// 常用工具类——Session操作类 /// <para> ---------- ...

  4. UITabBarController 基本定制

    UITabBarController 定制 特点 用法 1.准备好你的tabBar图片及其他图片(哈哈哈!!!!),我的图片都放在了Assets.xcassets中. 2.导入本工程中的Categro ...

  5. Java 反射 使用总结

    转载请标明出处:http://www.cnblogs.com/zhaoyanjun/p/6074887.html1 本文出自[赵彦军的博客] 反射机制是什么 反射机制是在运行状态中,对于任意一个类,都 ...

  6. React Native 之 组件化开发

    前言 学习本系列内容需要具备一定 HTML 开发基础,没有基础的朋友可以先转至 HTML快速入门(一) 学习 本人接触 React Native 时间并不是特别长,所以对其中的内容和性质了解可能会有所 ...

  7. RAC textView的双向绑定

    今天在写关于textView的数据绑定时原先写法是这样的: p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #78 ...

  8. SegmentControl 那些令人烦恼的事儿

    每个人的曾经都很苦逼.我知道我很卑微,但我不曾放慢脚步,在这条路上至死不悔.愿与你同行. UISegmentControl 概述 UISegmentControl 是系统的段选择控件,具有简洁大方的外 ...

  9. git与github安装、配置、pull、push

    操作系统是Ubuntu 16.04 LTS 64bit 1 安装git (1)安装 sudo apt-get install git-core (2)一些全局变量的初始化 在本地建立一个文件夹,然后做 ...

  10. hbase开发实例

    1.put/checkAndPut package com.testdata; import java.io.IOException; import org.apache.hadoop.conf.Co ...