Why does LSTM sequence to label give undefined categories?

When using an LSTM for sequence to label classification, training with 'trainNetwork' proceeds fine. However, when I try to classify with 'classify', the output is 'Undefined Category'. Why does this happen?

 채택된 답변

MathWorks Support Team
MathWorks Support Team 2019년 1월 15일

1 개 추천

This is likely due to having NaN values in the data.
As for why training proceeded fine, but classifying gave bad output, this is due to how the output of the neural net is treated internally. During training, the output from the network is a concrete number or vector, which may even be NaN.
Since it is something numeric, though, the training can proceed.
However, when calling classify, the classify function will try to get the output of the net, and then map it to a distinct category. Since the output from the net may be NaN based on training, or may give other not well formed outputs due to the NaN values in the data, this mapping will fail, resulting in the undefined categories.
To resolve this issue, do some pre-processing to remove the NaN values. You can completely remove the observations with NaN from your training and test data, or you can replace the NaN values with an arbitrary but consistent value.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Deep Learning for Image Processing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by