我在 matlab NN Toolbox 中运行大量数据集时遇到问题 - 问题是 -> 当我使用 trainlm 算法时,NN Toolbox 无法运行数据并显示 Out of memory 错误,但对于其他算法则没有内存问题。为什么会这样?此外,当我放置超过 15 个隐藏神经元时,它也会显示内存不足。如何解决这类问题?
还有一件事:我将 10%、45%、45% 的数据划分用于训练验证和测试,但是在运行代码后我发现在工作区中它执行了 25% 的数据用于训练、37% 的数据用于验证和 37% 的数据用于测试目的。如何解决这个问题?
有人知道如何解决这类问题吗?我很高兴收到评论和任何建议。谢谢。
我在运行 Windows 7 的笔记本电脑中使用 R2010b 版本的 MATLAB。
这是我用于训练数据集的代码
EX_355 = xlsread('Training Dataset.xlsx','B2:B435106');
EX_532 = xlsread('Training Dataset.xlsx','C2:C435106');
BA_355 = xlsread('Training Dataset.xlsx','D2:D435106');
BA_532 = xlsread('Training Dataset.xlsx','E2:E435106');
BA_1064 = xlsread('Training Dataset.xlsx','F2:F435106');
Reff = xlsread('Training Dataset.xlsx','G2:G435106');
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 = 10;
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;