導航:首頁 > 網路設置 > dbn網路需要多少數據訓練

dbn網路需要多少數據訓練

發布時間:2022-07-17 15:10:49

Ⅰ 能不能簡單舉個例子說明一下深度置信網路的(DBN)的分類過程主要針對文本分類,

function test_example_DBN
load mnist_uint8;

train_x = double(train_x) / 255;
test_x = double(test_x) / 255;
train_y = double(train_y);
test_y = double(test_y);

%% ex1 train a 100 hidden unit RBM and visualize its weights
rand('state',0)
dbn.sizes = [100];
opts.numepochs = 1;
opts.batchsize = 100;
opts.momentum = 0;
opts.alpha = 1;
dbn = dbnsetup(dbn, train_x, opts);
dbn = dbntrain(dbn, train_x, opts);
figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights

%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NN
rand('state',0)
%train dbn
dbn.sizes = [100 100];
opts.numepochs = 1;
opts.batchsize = 100;
opts.momentum = 0;
opts.alpha = 1;
dbn = dbnsetup(dbn, train_x, opts);
dbn = dbntrain(dbn, train_x, opts);

%unfold dbn to nn
nn = dbnunfoldtonn(dbn, 10); %類別數
nn.activation_function = 'sigm';

%train nn
opts.numepochs = 1;
opts.batchsize = 100;
nn = nntrain(nn, train_x, train_y, opts);
[er, bad] = nntest(nn, test_x, test_y);

assert(er < 0.10, 'Too big error');

Ⅱ matlab deeplearning toolbox 中的DBN輸入數據必須是(0,1]范圍內的嗎

程序如下:
function [nn, L] = nntrain(nn, train_x, train_y, opts, val_x, val_y)
%NNTRAIN trains a neural net
% [nn, L] = nnff(nn, x, y, opts) trains the neural network nn with input x and
% output y for opts.numepochs epochs, with minibatches of size
% opts.batchsize. Returns a neural network nn with updated activations,
% errors, weights and biases, (nn.a, nn.e, nn.W, nn.b) and L, the sum
% squared error for each training minibatch.

assert(isfloat(train_x), 'train_x must be a float');
assert(nargin == 4 || nargin == 6,'number ofinput arguments must be 4 or 6')

loss.train.e = [];
loss.train.e_frac = [];
loss.val.e = [];
loss.val.e_frac = [];
opts.validation = 0;
if nargin == 6
opts.validation = 1;
end

fhandle = [];
if isfield(opts,'plot') && opts.plot == 1
fhandle = figure();
end

m = size(train_x, 1);

batchsize = opts.batchsize;
numepochs = opts.numepochs;

numbatches = m / batchsize;

assert(rem(numbatches, 1) == 0, 'numbatches must be a integer');

L = zeros(numepochs*numbatches,1);
n = 1;
for i = 1 : numepochs
tic;

kk = randperm(m);
for l = 1 : numbatches
batch_x = train_x(kk((l - 1) * batchsize + 1 : l * batchsize), :);

%Add noise to input (for use in denoising autoencoder)
if(nn.inputZeroMaskedFraction ~= 0)
batch_x = batch_x.*(rand(size(batch_x))>nn.inputZeroMaskedFraction);
end

batch_y = train_y(kk((l - 1) * batchsize + 1 : l * batchsize), :);

nn = nnff(nn, batch_x, batch_y);
nn = nnbp(nn);
nn = nnapplygrads(nn);

L(n) = nn.L;

n = n + 1;
end

t = toc;

if ishandle(fhandle)
if opts.validation == 1
loss = nneval(nn, loss, train_x, train_y, val_x, val_y);
else
loss = nneval(nn, loss, train_x, train_y);
end
nnupdatefigures(nn, fhandle, loss, opts, i);
end

disp(['epoch ' num2str(i) '/' num2str(opts.numepochs) '. Took ' num2str(t) ' seconds' '. Mean squared error on training set is ' num2str(mean(L((n-numbatches):(n-1))))]);
nn.learningRate = nn.learningRate * nn.scaling_learningRate;
end
end

Ⅲ 深度信念網路為什麼不火

深度信念網路由於理論分析的難度大,加上訓練方法需要很多經驗和技巧,所以不火。
深度信念網路在2006年提出,它是一種生成模型,通過訓練其神經元間的權重,我們可以讓整個神經網路按照最大概率來生成訓練數據。我們不僅可以使用DBN識別特徵、分類數據,還可以用它來生成數據。
深度信念網路是神經網路的一種,既可以用於非監督學習,類似於一個自編碼機;也可以用於監督學習,作為分類器來使用。

Ⅳ 深度學習中的端到端是什麼概念

端到端指的是輸入是原始數據,輸出是最後的結果,非端到端的輸入端不是直接的原始數據,而是在原始數據中提取的特徵,這一點在圖像問題上尤為突出,因為圖像像素數太多,數據維度高,會產生維度災難,所以原來一個思路是手工提取圖像的一些關鍵特徵,這實際就是就一個降維的過程。
那麼問題來了,特徵怎麼提?
特徵提取的好壞異常關鍵,甚至比學習演算法還重要,舉個例子,對一系列人的數據分類,分類結果是性別,如果你提取的特徵是頭發的顏色,無論分類演算法如何,分類效果都不會好,如果你提取的特徵是頭發的長短,這個特徵就會好很多,但是還是會有錯誤,如果你提取了一個超強特徵,比如染色體的數據,那你的分類基本就不會錯了。
這就意味著,特徵需要足夠的經驗去設計,這在數據量越來越大的情況下也越來越困難。
於是就出現了端到端網路,特徵可以自己去學習,所以特徵提取這一步也就融入到演算法當中,不需要人來干預了。

閱讀全文

與dbn網路需要多少數據訓練相關的資料

熱點內容
如何找到網路的路由器密碼 瀏覽:279
在安裝網路後可否分裝兩個路由器 瀏覽:294
5g網路好還是信號好 瀏覽:24
提升網路的軟體下載 瀏覽:473
如何網路推廣建站 瀏覽:904
濟南天橋區電商網路營銷 瀏覽:54
電腦連完網路還能退嗎 瀏覽:155
wifi沒網路是怎麼辦 瀏覽:709
新的電腦沒網路怎麼設置 瀏覽:238
移動網路gprs 瀏覽:514
觀致5s中控屏顯示無網路怎麼連 瀏覽:379
手機網路如何共享給台式電腦用 瀏覽:749
蘋果手機網路制式在哪 瀏覽:410
更新後網路連接消失 瀏覽:530
車機的網路天線放哪裡 瀏覽:248
萊蕪移動網路怎麼樣 瀏覽:399
wifi只有一個網路 瀏覽:355
路由器網路刷新列表 瀏覽:325
wifi網路分解 瀏覽:446
阿里網路營銷方案 瀏覽:544

友情鏈接