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

4 visualizaciones (últimos 30 días)
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.

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 27 de Jun. de 2009
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];

Más respuestas (0)

Categorías

Más información sobre Deep Learning Toolbox en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Productos


Versión

R2008a

Community Treasure Hunt

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

Start Hunting!

Translated by