Array of neuralnet structs
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello everyone,
I'm using Matlab2010a and I do in a loop a several neural networks.
Then I'm trying to save all the neural networks, like above:
for k=1:20
clear cfnet1; clear tr;
cfnet1=newcf(P,T,2,{'tansig' 'tansig'});
cfnet1.trainParam.max_fail = 10;
cfnet1.trainParam.showWindow = 0;
[cfnet1,tr] = train(cfnet1,P,T);
TR(k)=tr;
NET(k)=cfnet1;
end
I can save all the 'tr' in an array, but in case of the neuralnet it is not possible.
Generates an error about arrays and not double values.
??? The following error occurred converting from network to double:
Error using ==> double
Conversion to double from network is not possible.
Did someone try it before ? Is it works in latest versions of Matlab ?
댓글 수: 0
채택된 답변
Sean de Wolski
2011년 8월 22일
I think you want TR, NET to be cell arrays or struct arrays?
NET = cell(20,1); %cell arrays
for..
NET{K} = cfnet1
end
댓글 수: 0
추가 답변 (2개)
Tiago
2011년 8월 22일
댓글 수: 3
Sean de Wolski
2011년 8월 22일
I'm using braces, you're using parenthesis!
NET{k} is much different than NET(K)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!