Why does LSTM sequence to label give undefined categories?

2 次查看(过去 30 天)
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
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 个)

类别

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