I have trained a LSTM neural network to classify some sequences. The sequence length is 50 and the number of classes is 4.
I tried the network to classify a new set of data for an external validation of the network perfomances.
I noticed that the classifications change depending on how I feed the network.
I tried two approach:
to feed the network with all the data in one time
to feed the network one sample at a time within a for loop
YPred_val1 = classify(net,X_valN);
for i = 1:size(X_valN,2)
YPred_val2(i) = classify(net,X_valN(:,i));
I thought the results would be identical (I expected YPred_val1 equal to YPred_val2) in the two tries but actually the classifications are different, about the 50% of the samples has a different predicted label comparing the results.
do you have any idea why? maybe I m missing something?