What is the difference between the ways of Predict and PredictAndUpdateState to update the network?
Hi All,
I am testing a trained LSTM network to finish the prediction task. I have used prerdict() and PredicAndUpdateState() to do the prediction respectively. The codes for both ways are as follows respectively:
(1). Using predict ()
YTest=predict(trainedNet,XTest); % XTest is the complete test data, which is a numeric array with the size of [16 x 272].
(2). Using PredictAndUpdateState()
for i=1:size(XTest,2)
Xt=XTest(:,i); % One coloum of XTest is extracted as the inputs of this timestep.
[trainedNet,YTest(:,i)]=PredictAndUpdateState(trainedNet,Xt); % Use the inputs of this timestep to predict the outputs, and update the network.
end
The test performance of using PredictAndUpdateState() is much worse than using predict(). But I have heard that both predict() and PredictAndUpdateState() will update the state of the network between each prediction. So, I wonder why the performances of those two functions are so different, and what is the difference between the ways of predict() and PredictAndUpdateState() to update networks.
Any help will be appredicted. Thank you so much!Hi All,
I am testing a trained LSTM network to finish the prediction task. I have used prerdict() and PredicAndUpdateState() to do the prediction respectively. The codes for both ways are as follows respectively:
(1). Using predict ()
YTest=predict(trainedNet,XTest); % XTest is the complete test data, which is a numeric array with the size of [16 x 272].
(2). Using PredictAndUpdateState()
for i=1:size(XTest,2)
Xt=XTest(:,i); % One coloum of XTest is extracted as the inputs of this timestep.
[trainedNet,YTest(:,i)]=PredictAndUpdateState(trainedNet,Xt); % Use the inputs of this timestep to predict the outputs, and update the network.
end
The test performance of using PredictAndUpdateState() is much worse than using predict(). But I have heard that both predict() and PredictAndUpdateState() will update the state of the network between each prediction. So, I wonder why the performances of those two functions are so different, and what is the difference between the ways of predict() and PredictAndUpdateState() to update networks.
Any help will be appredicted. Thank you so much! Hi All,
I am testing a trained LSTM network to finish the prediction task. I have used prerdict() and PredicAndUpdateState() to do the prediction respectively. The codes for both ways are as follows respectively:
(1). Using predict ()
YTest=predict(trainedNet,XTest); % XTest is the complete test data, which is a numeric array with the size of [16 x 272].
(2). Using PredictAndUpdateState()
for i=1:size(XTest,2)
Xt=XTest(:,i); % One coloum of XTest is extracted as the inputs of this timestep.
[trainedNet,YTest(:,i)]=PredictAndUpdateState(trainedNet,Xt); % Use the inputs of this timestep to predict the outputs, and update the network.
end
The test performance of using PredictAndUpdateState() is much worse than using predict(). But I have heard that both predict() and PredictAndUpdateState() will update the state of the network between each prediction. So, I wonder why the performances of those two functions are so different, and what is the difference between the ways of predict() and PredictAndUpdateState() to update networks.
Any help will be appredicted. Thank you so much! lstm, predict, predictandupdatestate, prediction, deep learning MATLAB Answers — New Questions