Maximum variable size allowed by the program is exceeded

2 views (last 30 days)
Hello, here is my code. My input is a 1080x14 matrix of doubles and target is 6x14 binary matrix. I keep getting this errors: "Error using zeros Maximum variable size allowed by the program is exceeded." "Error in nnMex2.codeHints (line 117) hints.TEMP = zeros(1,ceil(tempSize/8),'double');" The code works correclty with different data files. If someone can help me, thank you in advance.
input=importdata('input.txt');
target=importdata('output.txt');
target=target'; %size(input)= 6x14
input=input'; %size(target)= 1080x14
%initialize the network parameters
trainFcn = 'trainrp'; %training function
inputDelays = 1:4; %the delay
hiddenLayerSize = [30,20];
net = timedelaynet(inputDelays,hiddenLayerSize,trainFcn);
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
net.trainParam.epochs = 1000;
[trainP,valP,testP] = divideblock(input,0.7,0.15,0.15);
[trainT,valT,testT] = divideblock(target,0.7,0.15,0.15);
net = init(net);
%training
[net,tr] = train(net,[trainP,valP,testP],[trainT,valT,testT]);

Accepted Answer

Greg Heath
Greg Heath on 11 May 2017
Edited: Greg Heath on 11 May 2017
The numbers you have make no sense. Typically
1. The number of samples is much greater than the dimensionality
[ I N ] = size(input)
[ O N ] = size(target)
with
N >> max(I,O)
for example
N >~ 10 * max(I,O)
and sometimes (e.g., low SNR)
N >~ 30* max(I,O)
2. The number of training equations is much greater than the number of unknown weights.
a. For an I-H-O net
0.7*N*O >> (I+1)*H +(H+1)*O
b. For an I-H1-H2-O net
0.7*N*O >> (I+1)*H1+(H1+1)*H2+(H2+1)*O
Hope this helps.
Greg

More Answers (0)

Categories

Find more on Deep Learning Toolbox 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!