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?*

 採用された回答

Greg Heath
Greg Heath 2015 年 1 月 27 日
編集済み: Greg Heath 2015 年 1 月 27 日

0 投票

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDeep Learning Toolbox についてさらに検索

質問済み:

2015 年 1 月 26 日

編集済み:

2015 年 1 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by