日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

UFLDL教程:Exercise:Vectorization

發布時間:2023/12/13 编程问答 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 UFLDL教程:Exercise:Vectorization 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

載入數據并顯示


Deep Learning and Unsupervised Feature Learning Tutorial Solutions

下載MINIST數據集及加載數據集的函數。MINIST數據集的介紹。

% Change the filenames if you've saved the files under different names % On some platforms, the files might be saved as % train-images.idx3-ubyte / train-labels.idx1-ubyte images = loadMNISTImages('train-images.idx3-ubyte'); labels = loadMNISTLabels('train-labels.idx1-ubyte');% We are using display_network from the autoencoder code display_network(images(:,1:100)); % Show the first 100 images disp(labels(1:10));

修改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稀疏值懲罰項的權重

修改訓練集,把step1里面的patches的產生改為


%% STEP 1: Implement sampleIMAGES 第1步:實現圖片采樣 %實現圖片采樣后,函數display_network從訓練集中隨機顯示200張 % After implementing sampleIMAGES, the display_network command should % display a random sample of 200 patches from the dataset %從10000張中隨機選擇200張顯示 % patches = sampleIMAGES; % figure % display_network(patches(:,randi(size(patches,2),200,1)),8) % title('sampleIMAGES') %%為產生一個200維的列向量,每一維的值為0~10000中的隨機數,說明是隨機取200個patch來顯示images = loadMNISTImages('train-images.idx3-ubyte'); labels = loadMNISTLabels('train-labels.idx1-ubyte');% We are using display_network from the autoencoder code figure display_network(images(:,1:100)); % Show the first 100 images title('first100images') figure disp(labels(1:10)); title('first100label')patches=zeros(visibleSize,10000);for i=1:10000patches(:,i)=reshape(images(:,i),visibleSize,1); end% patches = normalizeData(patches); % 在實現手寫字符識別時,是不需要對其做歸一化處理的 %要清楚的是,MINIST數據集本身就已經對數據進行了歸一化的處理% Obtain random parameters theta 初始化參數向量theta theta = initializeParameters(hiddenSize, visibleSize);

為了提高效率,可把train.m中的 STEP 3: Gradient Checking這步注釋掉,因為在本例中訓練集更大,梯度檢查會比較慢。


參考文獻


https://github.com/jiandanjinxin/matlab_code-ufldl-exercise-/tree/master/vectorization_exercise

深度學習入門教程UFLDL學習實驗筆記二:使用向量化對MNIST數據集做稀疏自編碼

Deep Learning 2_深度學習UFLDL教程:矢量化編程(斯坦福大學深度學習教程)

吳恩達 Andrew Ng 的公開課

總結

以上是生活随笔為你收集整理的UFLDL教程:Exercise:Vectorization的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。