Matlab Neural network Mini-batch training

5 ビュー (過去 30 日間)
Elad
Elad 2015 年 11 月 14 日
コメント済み: peterukk 2017 年 9 月 27 日
I am now starting to work with neural network toolbox in matlab for big data And I have quite a big dataset of medical image patches.
Currently training is quite slow and I want to use stochastic(feed the net one example at a time)/mini-batch(feed the network few examples at a time) training.
So : Is there a way to use mini-batch learning in matlab?
I found the "adapt" function however in their documentation matlab doesn't recommend using it, The optimal would be some form of training function that would automatically split my data to batches,
I did try several calls to batch on my own with 1 epoch however it didnt get as good results as a normal autoencoder
autotest = configAutoEncoder( 100 , 'epochs' , 1 , 'L2WeightRegularization' , .004 ,'sparsityRegularization' , 4 , 'sparsity' , .15);
autotest.trainParam.showWindow = 0;
epochs = 100;
batchSize = 5000;
batchStart = 1:batchSize:size(xTrain,2)-batchSize+1;
idx = randperm(size(xTrain,2));
idx = 1:size(xTrain,2);
pr = nan(epochs,length(batchStart));
for epoch = 1:epochs
for k = 1:length(batchStart)
bs = batchStart(k);
bidx = idx(bs:bs+batchSize-1);
[ autotest , tr ] = train( autotest , ...
xTrain(:,bidx) , xTrain(:,bidx) ) ;
pr(epoch,k) = tr.perf(end);
end
fprintf( 'epoch:%d , performence : %.2f\n' , epoch , pr(epoch,end) ) ;
end
I am using matlab 2015a Thanks,
  2 件のコメント
Ekta Prashnani
Ekta Prashnani 2016 年 1 月 6 日
I have the same question. Can minibatch/stochastic training be done using neural network toolbox?
peterukk
peterukk 2017 年 9 月 27 日
I also want to know this! Please help! I have been digging and digging but could not find an answer..there must be some way to apply minibatch training using e.g. the SCG training function (in my case)

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by