convolution

First, we want to compute σ(Wx(r,c) + b) for all valid (r,c) (valid meaning that the entire 8x8 patch is contained within the image; this is as opposed to a full convolution, which allows the patch to extend outside the image, with the area outside the image assumed to be 0), where W and b are the learned weights and biases from the input layer to the hidden layer, and x(r,c) is the 8x8 patch with the upper left corner at (r,c).

卷积操作是为了解除输入层和隐藏层之间的全链接 —— 全链接会带来很高的计算成本

这样只是对局部patch进行sigmoid(W,b),卷积操作使用matlab的conv2函数

First, conv2 performs a 2-D convolution, but you have 5 "dimensions" - image number, feature number, row of image, column of image, and (color) channel of image - that you want to convolve over. Because of this, you will have to convolve each feature and image channel separately for each image, using the row and column of the image as the 2 dimensions you convolve over. This means that you will need three outer loops over the image number imageNum, feature number featureNum, and the channel number of the image channel.

卷积的作用对象不是直接的像素点,而是图像中提取出的特征

Second, because of the mathematical definition of convolution, the feature matrix must be "flipped" before passing it toconv2. The following implementation tip explains the "flipping" of feature matrices when using MATLAB's convolution

使用matlab计算卷积,需要对卷积patch进行反转

In particular, you did the following to the patches:

  1. subtract the mean patch, meanPatch to zero the mean of the patches
  2. ZCA whiten using the whitening matrix ZCAWhite.

These same three steps must also be applied to the input image patches.

Taking the preprocessing steps into account, the feature activations that you should compute is , whereT is the whitening matrix and is the mean patch. Expanding this, you obtain , which suggests that you should convolve the images with WT rather than W as earlier, and you should add , rather than just b toconvolvedFeatures, before finally applying the sigmoid function.

对每个patch计算其均值和ZCA whiten

Pooling

首先在前面的使用convolution时是利用了图像的stationarity特征,即不同部位的图像的统计特征是相同的,那么在使用convolution对图片中的某个局部部位计算时,得到的一个向量应该是对这个图像局部的一个特征,既然图像有stationarity特征,那么对这个得到的特征向量进行统计计算的话,所有的图像局部块应该也都能得到相似的结果。对convolution得到的结果进行统计计算过程就叫做pooling,由此可见pooling也是有效的。常见的pooling方法有max pooling和average pooling等。并且学习到的特征具有旋转不变性

Convolution & Pooling exercise的更多相关文章

  1. ufldl学习笔记和编程作业:Feature Extraction Using Convolution,Pooling(卷积和汇集特征提取)

    ufldl学习笔记与编程作业:Feature Extraction Using Convolution,Pooling(卷积和池化抽取特征) ufldl出了新教程,感觉比之前的好,从基础讲起.系统清晰 ...

  2. [CS231n-CNN] Convolutional Neural Networks: architectures, convolution / pooling layers

    课程主页:http://cs231n.stanford.edu/     参考: 细说卷积神经网络:http://blog.csdn.net/han_xiaoyang/article/details/ ...

  3. Deeplearning - Overview of Convolution Neural Network

    Finally pass all the Deeplearning.ai courses in March! I highly recommend it! If you already know th ...

  4. Deep Learning 19_深度学习UFLDL教程:Convolutional Neural Network_Exercise(斯坦福大学深度学习教程)

    理论知识:Optimization: Stochastic Gradient Descent和Convolutional Neural Network CNN卷积神经网络推导和实现.Deep lear ...

  5. 【转】Caffe初试(八)Blob,Layer和Net以及对应配置文件的编写

    深度网络(net)是一个组合模型,它由许多相互连接的层(layers)组合而成.Caffe就是组建深度网络的这样一种工具,它按照一定的策略,一层一层的搭建出自己的模型.它将所有的信息数据定义为blob ...

  6. 【转】Caffe初试(五)视觉层及参数

    本文只讲解视觉层(Vision Layers)的参数,视觉层包括Convolution, Pooling, Local Response Normalization (LRN), im2col等层. ...

  7. 【转】Caffe初试(四)数据层及参数

    要运行caffe,需要先创建一个模型(model),如比较常用的Lenet,Alex等,而一个模型由多个层(layer)构成,每一层又由许多参数组成.所有的参数都定义在caffe.proto这个文件中 ...

  8. Caffe学习系列(2):数据层及参数

    要运行caffe,需要先创建一个模型(model),如比较常用的Lenet,Alex等, 而一个模型由多个屋(layer)构成,每一屋又由许多参数组成.所有的参数都定义在caffe.proto这个文件 ...

  9. Caffe学习系列(3):视觉层(Vision Layers)及参数

    所有的层都具有的参数,如name, type, bottom, top和transform_param请参看我的前一篇文章:Caffe学习系列(2):数据层及参数 本文只讲解视觉层(Vision La ...

随机推荐

  1. ZOJ 3365 Integer Numbers

    Integer Numbers Time Limit: 1000ms Memory Limit: 32768KB This problem will be judged on ZJU. Origina ...

  2. 压缩和还原压缩的JS代码

    压缩JS代码:packer – 最好用的 javascript 压缩工具地址: http://dean.edwards.name/packer/ http://kan.willin.org/?page ...

  3. ShopEx文章页添加上一篇下一篇功能

    在全部的文章页中,会常常发现都会有这么一个功能.能引导用户去查看上一篇文章或下一篇文章,而在ShopEx中,我DEZEND了一下文章模型.并没有找到上一篇这种函数功能,因此,这就须要我们手动在相应的文 ...

  4. APP-午饭去哪吃

    走到这个快节奏的城市中.部门聚餐.朋友吃饭这些都是日常生活中时有发生的事情,往往吃的东西都是千篇一律,图的也仅仅剩下的是环境了.那么.非常纠结常常去的地方,怎么办呢?来吧.我们随机摇一个吧! wate ...

  5. Mysql写出高质量的sql语句的几点建议

    CleverCode在实际的工作也写过一些低效率的sql语句.这些语句会给数据库带来非常大的压力.最基本的表现就是sql语句执行慢,后来逐渐的去优化和尝试. 总结了一些高质量的sql语句的写法.这里C ...

  6. android 自己定义标签的使用,实现扁平化UI设计

    2014年8月6日11:06:44 android对自己定义标签的使用.实现扁平化UI设计: 1.attrs.xml文件里自己定义标签 如: <?xml version="1.0&qu ...

  7. 适配 iOS 8 时遇到的问题两则:远程推送和 Unwind Segue

    原文:http://imtx.me/archives/1910.html 昨天我在微博上吐槽:iOS 8 / Xcode 6 真是史上对开发人员最糟糕的版本号了.收到非常多朋友表达同感. 之所以这么说 ...

  8. Car Talk1

    This question is based on a Puzzler that was broadcast on the radioprogram Car Talk1: “I was driving ...

  9. BootStrap--panel面板

    1 <div class="panel panel-default"> <div class="panel-body"> 这是一个基本的 ...

  10. luoguP1401 城市(二分答案+最大流)

    题意 N(2<=n<=200)个城市,M(1<=m<=40000)条无向边,你要找T(1<=T<=200)条从城市1到城市N的路,使得最长的边的长度最小,边不能重复 ...