I got different outputs from the trained network
Show older comments
Hi all, I already trained a LSTM network and use it to classify the testset. However, the outputs are different when I input the testset samples one by one through for loop and input it as an array. Below is the code:
% Xtest is a 81-1 vector.
% case1: one by one input through for loop
for i = 1:81
testPred_single(i) = classify(LSTM_net,Xtest(i),'SequenceLength','longest');
end
% case2: array input
testPred=classify(LSTM_net,Xtest,'SequenceLength','longest');
Below is the part element of the output variables testPred_single and testPred.

Could anyone explain what causes the gap between this two output variables? Thanks.
2 Comments
Aquatris
on 10 Jul 2024
I am by no means an expert but my understanding is, as per definition of LSTM, they are not good when the input data is not a sequence. When you give the inputs individually, you basically remove the sequence information. Hence it comes up with a different output.
peng yu
on 11 Jul 2024
Accepted Answer
More Answers (0)
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!