Convolution & Pooling exercise
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:
- subtract the mean patch, meanPatch to zero the mean of the patches
- 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的更多相关文章
- ufldl学习笔记和编程作业:Feature Extraction Using Convolution,Pooling(卷积和汇集特征提取)
ufldl学习笔记与编程作业:Feature Extraction Using Convolution,Pooling(卷积和池化抽取特征) ufldl出了新教程,感觉比之前的好,从基础讲起.系统清晰 ...
- [CS231n-CNN] Convolutional Neural Networks: architectures, convolution / pooling layers
课程主页:http://cs231n.stanford.edu/ 参考: 细说卷积神经网络:http://blog.csdn.net/han_xiaoyang/article/details/ ...
- Deeplearning - Overview of Convolution Neural Network
Finally pass all the Deeplearning.ai courses in March! I highly recommend it! If you already know th ...
- Deep Learning 19_深度学习UFLDL教程:Convolutional Neural Network_Exercise(斯坦福大学深度学习教程)
理论知识:Optimization: Stochastic Gradient Descent和Convolutional Neural Network CNN卷积神经网络推导和实现.Deep lear ...
- 【转】Caffe初试(八)Blob,Layer和Net以及对应配置文件的编写
深度网络(net)是一个组合模型,它由许多相互连接的层(layers)组合而成.Caffe就是组建深度网络的这样一种工具,它按照一定的策略,一层一层的搭建出自己的模型.它将所有的信息数据定义为blob ...
- 【转】Caffe初试(五)视觉层及参数
本文只讲解视觉层(Vision Layers)的参数,视觉层包括Convolution, Pooling, Local Response Normalization (LRN), im2col等层. ...
- 【转】Caffe初试(四)数据层及参数
要运行caffe,需要先创建一个模型(model),如比较常用的Lenet,Alex等,而一个模型由多个层(layer)构成,每一层又由许多参数组成.所有的参数都定义在caffe.proto这个文件中 ...
- Caffe学习系列(2):数据层及参数
要运行caffe,需要先创建一个模型(model),如比较常用的Lenet,Alex等, 而一个模型由多个屋(layer)构成,每一屋又由许多参数组成.所有的参数都定义在caffe.proto这个文件 ...
- Caffe学习系列(3):视觉层(Vision Layers)及参数
所有的层都具有的参数,如name, type, bottom, top和transform_param请参看我的前一篇文章:Caffe学习系列(2):数据层及参数 本文只讲解视觉层(Vision La ...
随机推荐
- thymeleaf 拼接 超链接
<dd><a th:href="@{/get/{id}(id=${user.id})}">基本资料</a></dd>
- SWT自定义选项卡CTabFolder
SWT自定义选项卡CTabFolder 学习了:http://blog.csdn.net/dreajay/article/details/17391731 package com.swt; impor ...
- ScrollView反弹效果的实现
发现非常多APP的界面都能够滑动,QQ.微信等等,自己琢磨了下.效果例如以下: 代码:ScrollView package com.wsj.wsjdemo; import android.conten ...
- 在 Win8.1 上安装 Dedup
install-package Microsoft-Windows-ServerCore-FullServer-Package~31bf3856ad364e35~amd64~~6.3.9600.163 ...
- hdoj--1869--六度分离(floyd)
六度分离 Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submi ...
- SpringMVC后台使用对象接受参数字符串转日期
在springMVC配置文件中加入: <bean id="dateConvert" class="com.iomp.util.DateConvert"/& ...
- Java类和对象9
(1)创建一个叫做机动车的类:属性:车牌号(String),车速(int),载重量(double)功能:加速(车速自增).减速(车速自减).修改车牌号,查询车的载重量.编写两个构造方法:一个没有形参, ...
- SharePoint 修改完或制作完一定要发布
设置了匿名访问但是网站就是需要登录,找了很多问题. 首先想到的映射问题,然后努力检查,最后把代码删掉,然后把站删掉,最后测试出来问题. 点击上方[网站设置] 把修改过的文件发布. 母版也和布局页 一定 ...
- JavaScript中函数作为另一个函数的参数的时候它存在于哪个作用域
一直对函数作为参数被传递进另外一个函数理解的不是很清除.先看下这段代码吧: function test(fn){ var bar = 1; fn(); } var bar = 99; test(fun ...
- windows如何批量添加路由表
我大约有2000条路由,需要批量导入,如何才能快速导入,快速删除呢.如果直接用命令添加路由表的话感觉很慢. windows如何批量添加路由表 >> csharp这个答案描述的挺清楚的:ht ...
, 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.