Recurrent neural network for real-time prediction

조회 수: 5 (최근 30일)
Eason
Eason 2017년 7월 21일
댓글: Hamid Radmard Rahmani 2019년 2월 10일
Hello,
I'd like to use first train RNN with dataset A contains input and targets and use the trained RNN to get prediction of dataset B with only input in it, but I encountered a problem that the function "preparets" requires targets and in reality I need RNN to give me the targets.

채택된 답변

Greg Heath
Greg Heath 2017년 7월 30일
You can use
[ net tr Y E Xf Af ] = train( net, X, T, Xi, Ai );
where Y = net(X,Xi,Ai)
and E = gsubtract(T,Y)
Hope this helps.
Thank you for formally accepting my answer
Greg

추가 답변 (3개)

Greg Heath
Greg Heath 2017년 7월 24일
편집: Greg Heath 2017년 7월 25일
Words are nice but including code is much better. Which training algorithm are you using ? ...NARXNET ?
Requiring a target to obtain an answer to a test input makes no sense. Where did you get that idea?
Reread the documentation.
Hope this helps,
Greg

Eason
Eason 2017년 7월 24일
Hi Greg, I just realized that I made a mistake when using the function preparets. As you can see the code below. I will first train a RNN then I will feed the input data to get predictions.
%configure RNN
net = recurrent(1:n,3:5);%1 hidden layer of 10 units,2 time step
[Xs,Xi,Ai,Ts] = preparets(net,X,T);% prepare input to get time series for training
net = train(net,Xs,Ts,Xi,Ai);%train the net
%get new input
[Xsn,Xin,Ain] = preparets(net,Xn);% prepare input to get time series for training
Yn = net(Xsn,Xin,Ain);% get prediction
Thanks,
Yiwen
  댓글 수: 3
Greg Heath
Greg Heath 2017년 7월 27일
Is recurrent a function you designed? I don't have it in my toolbox.
Hamid Radmard Rahmani
Hamid Radmard Rahmani 2019년 2월 10일
Hi Yiwen,
I am confused!
The output shall be also inlcuded in Xn to be able to use the preduced Xsn as input to the net.
So always it is required to have output as part of input to feed the RNN in matlab.
Can any body explain how to feed new data, in which only the inputs are exists, to a trained RNN to get outputs?
Thanks

댓글을 달려면 로그인하십시오.


Parimal Sarathi
Parimal Sarathi 2017년 11월 20일
Hi Greg, I am also trying to solve a problem where I need to predict the outputs of a system (represented by the NarxNet Neural Network model). While training the network I am using a open loop network. For this I need to give the targets for preparets to format the training data for training. After training the network I am closing the network using
[cnet,cinitialinputdelay,cinitiallayerdelay] = closeloop(net,oinitialinputdelay,oinitiallayerdelay);
but this gives a very high performance values as compared to the one given by the open loop training process. When I investigated this I found out that the 4th parameter returned by preparets function, i.e. the Initial Layer Delay, is the different for the cases.
Just for the sake of the sanctity of the problem, I tried entering the parameters for the closed loop simulation after computing their values from the preparets function (which required me to give in the targets that my network needs to achieve). I couldn't find anything on how the Initial Layer Delay (Ai) is being calculated.

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by