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?*
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!