How to improve neural network closedloop performance?

I'm trying to simulate a Thermal Storage with Matlab NARX to predicting a time series problem. My input data are ambient Temp. , Direct Sun Radiation and Diffuse Sun Radiation [3*1440]. My Output is 4 surface Temp of the storage [4*1440]. 1440 time points of a day. I'm trying to build a network to predict the Output for another day. My problem is that the closedloop Performance is really high (about 10) , although the network performance is good (about 0.005 ). My network has three layers [30 25 20]. Second Layer has 'logsig' as transfer function. I've trained the network twice before closing the loop. I've used 'trainbr' for function and 'divideblock' for dividing the data. I've tried to train the Network also after closing the loop but the performance got poorer.
X = tonndata(ID,true,false);
T = tonndata(OD,true,false);
trainFcn = 'trainbr'
inputDelays = 1:4;
feedbackDelays = 1:4;
hiddenLayerSize = [30 25 20];
net = narxnet(inputDelays,feedbackDelays,hiddenLayerSize,'open',trainFcn);
net.layers{2}.transferFcn = 'logsig';
net.inputs{1}.processFcns = {'removeconstantrows','mapminmax'};
net.inputs{2}.processFcns = {'removeconstantrows','mapminmax'};
[x,xi,ai,t] = preparets(net,X,{},T);
net.divideFcn = 'divideblock';
net.divideMode = 'time'
net.divideParam.trainRatio = 90/100;
net.divideParam.valRatio = 5/100;
net.divideParam.testRatio = 5/100;
net.performFcn = 'mse'
net.plotFcns = {'plotperform','plottrainstate', 'ploterrhist', ...
'plotregression', 'plotresponse', 'ploterrcorr', 'plotinerrcorr'};
net.trainParam.goal=.05;
net.trainParam.max_fail=6;
[net,tr] = train(net,x,t,xi,ai);
net.trainParam.goal=.005;
net.trainParam.max_fail=6;
[net,tr] = train(net,x,t,xi,ai);
y = net(x,xi,ai);
e = gsubtract(t,y);
performance = perform(net,t,y)
I've tried many different layer size and different delays different functions ... that was the best one till now! Can anyone help me with this problem? how should I train the network after closing the loop? is this correct?
[xc,xic,aic,tc] = preparets(netc,X,{},T);
yc = netc(xc,xic,aic);
closedLoopPerformance = perform(net,tc,yc)
netc.trainParam.goal=1;
netc.trainParam.max_fail=6;
[net,tr] = train(netc,xc,tc,xic,aic);

3 Comments

You have made some very strange decisions in your open loop code.
1. It looks like you have 3 input and 4 output measurements per minute. However, you never estimate
a. Significant input/output crosscorrelation lags (to choose ID)
b. Significant output autocorrelation lags (to choose FD)
2. Do you really need an input per minute to predict the output?
3. Trainbr ? Are you getting a val output?
4. Why have you decided on a 3 hidden layer configuration when one hidden layer is sufficient?
5. Why clutter the code with statements that assign default values?
6. The layer 2 logsig assignment makes no sense
etc
I do not believe you have to stray very far from the examples I have posted.
The less conventional your open loop code, the harder it is to get a satisfactory closed loop performance.
I'm afraid your code is too unconventional for me to help in a reasonable amount of time.
Please take a look at some of my examples.
Sorry I cannot give more advice than I have alread given in past narxnet postings.
Greg
Thanks for your comment Greg, sorry, but I don't get your first comment, what are cross-correlation and autocorrelation lags? and how should I estimate them?
The obvious answer is to search the NEWSGROUP and ANSWERS using those terms. For example, start with the NEWSGROUP searches
greg crosscorrelation 46 hits
greg cross-correlation 48 hits
greg cross correlation 73 hits
etc
Greg

Sign in to comment.

Answers (0)

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Asked:

on 9 Nov 2015

Commented:

on 13 Nov 2015

Community Treasure Hunt

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

Start Hunting!