Why does my neural network fail to train when I introduce feedback components using Neural Network Toolbox 6.0 (R2008a)?

조회 수: 4 (최근 30일)
I am creating a custom Elman network as follows and attempting to train it:
clear variables;
p = rand(2,10);
t = rand(2,10);
net=newelm(p,t,[5,4,2],{'tansig','tansig','purelin'},'trainrp');
net.layerConnect(1,1)=0;
net.layerConnect(2,2)=0;
net.layerConnect(1,3)=1;
net=init(net);
[net,tr]=train(net,p,t);
However I get the following error message
??? Error using ==> network.train at 129
Network contains a zero-delay loop.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2009년 6월 27일
This error occurs because the following line in the code
net.layerConnect(1,3)=1;
creates a feedback loop with a zero delay connection between the output of the third hidden layer and the input of the first layer, which implies that there is no good starting point for training the network.
In general, all non-feed-forward lines require non-zero delays. To make the above network work, one can modify the delay value as follows
net.layerWeights{1,3}.delays = [1];

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

제품


릴리스

R2008a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by