Maximum variable size allowed by the program is exceeded

2 ビュー (過去 30 日間)
Lyn Da
Lyn Da 2017 年 5 月 10 日
コメント済み: Lyn Da 2017 年 5 月 11 日
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]);

採用された回答

Greg Heath
Greg Heath 2017 年 5 月 11 日
編集済み: Greg Heath 2017 年 5 月 11 日
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

その他の回答 (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