Why does LSTM sequence to label give undefined categories?
2 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2019-1-15
回答: MathWorks Support Team
2019-3-27
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
2019-1-15
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Deep Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!