• 【DeepLearning】Exercise:Vectorization


    Exercise:Vectorization

    习题的链接:Exercise:Vectorization

    注意点:

    MNIST图片的像素点已经经过归一化。

    如果再使用Exercise:Sparse Autoencoder中的sampleIMAGES.m进行归一化,

    将使得训练得到的可视化权值如下图:

    更改train.m的参数设置

    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 

    更改sampleIMAGES.m

    function patches = sampleIMAGES()
    % sampleIMAGES
    % Returns 10000 patches for training
    
    load images;    % load images from disk 
    
    patchsize = 28;  % we'll use 28x28 patches 
    numpatches = 10000;
    
    % Initialize patches with zeros.  Your code will fill in this matrix--one
    % column per patch, 10000 columns. 
    patches = zeros(patchsize*patchsize, numpatches);
    
    %% ---------- YOUR CODE HERE --------------------------------------
    %  Instructions: Fill in the variable called "patches" using data 
    %  from images.  
    
    patches = images(:, 1:10000);

    训练得到的W1可视化:

  • 相关阅读:
    窗内的星星
    亚特兰蒂斯
    你能回答这些问题吗
    区间最大公约数
    集训队8月14日(树状数组)
    一个简单的整数问题2
    谜一样的牛
    楼兰图腾
    Eternal Victory
    集训队8月12日(并查集)
  • 原文地址:https://www.cnblogs.com/ganganloveu/p/4195584.html
Copyright © 2020-2023  润新知