UFLDL教程 Exercise:Vectorization(答案)
2014-10-11 20:41
344 查看
(注:本人刚刚着手DL,所以博文也仅属于学习笔记范畴,每篇博文我都会将内容摘抄地址附在最上面,如果冒犯原作者,请见谅哈~)
参考链接:
/article/5196566.html
网页教程参考:
Exercise:Vectorization
这一节练习是教我们怎么矢量化编程来代替低效率的for循环,用了MNIST数据集,其实和上一节基本一样,只是数据集变了而已,因为上一个博文(Exercise:Sparse
autoencoder)代码部分已经是运用矢量化编程的了,所以步骤有以下两步:
1、train.m文件中把step0里面的各个参数调整成这样:
2、step1里面的写成这样:
注意:一定要把梯度检查注释掉,因为这次的数据集相对比较大,梯度检查所以会很慢。训练结束后会得到这种样子的图片:
参考链接:
/article/5196566.html
网页教程参考:
Exercise:Vectorization
这一节练习是教我们怎么矢量化编程来代替低效率的for循环,用了MNIST数据集,其实和上一节基本一样,只是数据集变了而已,因为上一个博文(Exercise:Sparse
autoencoder)代码部分已经是运用矢量化编程的了,所以步骤有以下两步:
1、train.m文件中把step0里面的各个参数调整成这样:
<span style="font-size:14px;">visibleSize = 28*28; % number of input units hiddenSize = 196; % number of hidden units sparsityParam = 0.1; % desired average activation of the hidden units. % (This was denoted by the Greek alphabet rho, which looks like a lower-case "p", % in the lecture notes). lambda = 3e-3; % weight decay parameter beta = 3; % weight of sparsity penalty term</span>
2、step1里面的写成这样:
<span style="font-size:14px;">images = loadMNISTImages('train-images.idx3-ubyte'); patches = images(:,1:10000); % % patches = sampleIMAGES;</span>
注意:一定要把梯度检查注释掉,因为这次的数据集相对比较大,梯度检查所以会很慢。训练结束后会得到这种样子的图片:
相关文章推荐
- UFLDL教程答案(2):Exercise:Vectorization
- UFLDL教程Exercise答案(2):Vectorization
- UFLDL教程Exercise答案(7):Learning color features with Sparse Autoencoders
- UFLDL教程答案(3):Exercise:PCA_in_2D&PCA_and_Whitening
- UFLDL教程Exercise答案(8):Convolution and Pooling
- UFLDL教程练习(exercise)答案(2)
- UFLDL教程Exercise答案(3.2):PCA and Whitening
- UFLDL教程练习(exercise)答案(1)
- UFLDL教程答案(7):Exercise:Learning color features with Sparse Autoencoders
- UFLDL教程 Exercise:Sparse Autoencoder(答案)
- UFLDL教程答案(1):Exercise:Sparse_Autoencoder
- UFLDL教程答案(6):Exercise:Implement deep networks for digit classification
- UFLDL教程答案(8):Exercise:Convolution and Pooling
- UFLDL教程Exercise答案(1):Sparse Autoencoder
- UFLDL教程练习(exercise)答案(1)
- UFLDL教程答案(4):Exercise:Softmax Regression
- UFLDL教程Exercise答案(3.1):PCA in 2D
- UFLDL教程:Exercise:Vectorization
- UFLDL教程答案(5):Exercise:Self-Taught Learning
- UFLDL教程Exercise答案(4):Softmax Regression