Does the input size of sequenceInputLayer have to be set 1?
4 次查看(过去 30 天)
显示 更早的评论
i followed the example https://ww2.mathworks.cn/help/textanalytics/ug/classify-text-data-using-deep-learning.html.
The network is as follows:
inputSize = 1;
embeddingDimension = 50;
numHiddenUnits = 80;
numWords = enc.NumWords;
numClasses = numel(categories(YTrain));
layers = [ ...
sequenceInputLayer(inputSize)
wordEmbeddingLayer(embeddingDimension,numWords)
lstmLayer(numHiddenUnits,'OutputMode','last')
fullyConnectedLayer(numClasses)
softmaxLayer
classificationLayer]
I only tried to change inputSize = 2, then the network can not be trained with the error:
Does the input size of sequenceInputLayer have to be set 1?
0 个评论
回答(1 个)
Zhiyu WANG
2022-5-25
Becasue the input sequence data is a 1 by 10 double.It menas each time you take 1 token out of the sequence.
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!