My laptop ram is 2.93 GB (showing in the PC) even though it is 8 GB ram and running on 32 bit windows 7 OS.
How to solve out of memory errors in Matlab Neural Networks toolbox for large datasets?
1 view (last 30 days)
Show older comments
Hi all,
I have huge input datasets to use in NN Toolbox, but i can't use more than 20 hidden neurons because toolbox shows out of memory errors. It shows like this:
??? Error using ==> horzcat
Out of memory. Type HELP MEMORY for your options.
Error in ==> C:\Program Files\MATLAB\R2010b\toolbox\nnet\nnutils\+nnprop\jac_s.p>jac_s at 285
How to solve this problem, I hope somebody will help me out of this problem.
Thanks.
Here is my code that i used:
-------------------------------------
EX_355 = xlsread('(10nm-50nm).xlsx','A2:A165238');
EX_532 = xlsread('(10nm-50nm).xlsx','B2:B165238');
BA_355 = xlsread('(10nm-50nm).xlsx','C2:C165238');
BA_532 = xlsread('(10nm-50nm).xlsx','D2:D165238');
BA_1064 = xlsread('(10nm-50nm).xlsx','E2:E165238');
Reff = xlsread('(10nm-50nm).xlsx','F2:F165238');
Input(1,:) = EX_355;
Input(2,:) = EX_532;
Input(3,:) = BA_355;
Input(4,:) = BA_532;
Input(5,:) = BA_1064;
Target(1,:) = Reff;
net = feedforwardnet;
net = configure(net,Input,Target);
net = init(net);
inputs = Input;
targets = Target;
hiddenLayerSize = 21;
net = fitnet(hiddenLayerSize);
net.inputs{1}.processFcns = {'removeconstantrows','mapminmax'};
net.outputs{2}.processFcns = {'removeconstantrows','mapminmax'};
net.divideFcn = 'dividerand';
net.divideMode = 'sample';
net.divideParam.trainRatio = 10/100;
net.divideParam.valRatio = 45/100;
net.divideParam.testRatio = 45/100;
net.trainFcn = 'trainlm';
net.performFcn = 'mse';
net.plotFcns = {'plotperform','plottrainstate','ploterrhist', ... 'plotregression', 'plotfit'};
[net,tr] = train(net,inputs,targets);
outputs = net(inputs);
errors = gsubtract(targets,outputs);
performance = perform(net,targets,outputs)
trainTargets = targets .* tr.trainMask{1};
valTargets = targets .* tr.valMask{1};
testTargets = targets .* tr.testMask{1};
net.trainParam.epochs;
net.trainParam.time;
net.trainParam.goal;
net.trainParam.min_grad;
net.trainParam.mu_max;
net.trainParam.max_fail;
net.trainParam.show;
Answers (1)
Jason Ross
on 4 Oct 2012
Edited: Jason Ross
on 4 Oct 2012
If you are running a 32-bit OS, you won't be able to access more than 4 GB RAM. You will need to install a 64-bit version of Windows (and MATLAB) to access all 8 GB in your machine.
0 Comments
See Also
Categories
Find more on Define Shallow Neural Network Architectures in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!