How to set up weights/bias of the NARX neural network

I want to set up the range of weights of NARX network in [-0.8,0.8], how can i set up it? The number of the output neurons is 2.
my code is that
ID=1:2; FD=1:2; H=[7,15];
net=narxnet(ID,FD,H);
[inputs,inputstates,layerstates,targets]=preparets(net,T,{},P);
net.inputs{1}.processFcns = {'mapstd','removeconstantrows','mapminmax'};
net.inputs{2}.processFcns = {'mapstd','removeconstantrows','mapminmax'};
net.initFcn='initlay';
net.layers{2}.initFcn='initwb';
net.layers{3}.initFcn='initwb';
net.layerWeights{2,1}.initFcn='randsmall';
net.layerWeights{3,2}.initFcn='randsmall';
This method can initialize weights to be [-0.1,0.1].And it's right.
But when i want to use the following method to get the initial range [-0.8,0.8],it's wrong. The code is shown in below.
net=narxnet(ID,FD,H);
[inputs,inputstates,layerstates,targets]=preparets(net,T,{},P);
net.inputs{1}.processFcns = {'mapstd','removeconstantrows','mapminmax'};
net.inputs{2}.processFcns = {'mapstd','removeconstantrows','mapminmax'};
net.initFcn='initlay';
net.layers{2}.initFcn='initwb';
net.layers{3}.initFcn='initwb';
net.layerWeights{2,1}.initFcn=tonndata(0.8*rands(25,7));
net.layerWeights{3,2}.initFcn=tonndata(0.8*rands(2,25));
*How can i do it?*

 Respuesta aceptada

Greg Heath
Greg Heath el 27 de En. de 2015
Editada: Greg Heath el 27 de En. de 2015
You are concentrating on the wrong stuff. The most important things are (assuming a SINGLE hidden layer)
1. Obtain a good set of crosscorrelation delays for ID (e.g., using NNCORR)
2. Obtain a good set of autocorrelation delays for FD (e.g., using NNCORR)
3. Given ID and FD, find the smallest successful value for H considering
~ 10 different random weight initialization trials for each H candidate.
MATLAB defaults will take care of the rest. Search for my openloop examples
greg nncorr narxnet
greg narxnet
Then consider closing the feedback loop
greg closeloop
Hope this helps.
Thank you for formally accepting my answer
Greg

Más respuestas (0)

Categorías

Más información sobre Deep Learning Toolbox en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 26 de En. de 2015

Editada:

el 27 de En. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by