LSTM with multiple Softmax layers

1 回表示 (過去 30 日間)
Salma Matoussi
Salma Matoussi 2020 年 6 月 17 日
回答済み: Bhargavi Maganuru 2020 年 7 月 6 日
Hi,
I am working with LSTM model. It receives sequences of N users with B features [matrix of N*B ]. And I would like to generate outputs in form of sequences with N users and 3 labels [matrix of N*3]. Indeed, I would like to perform 3 different classification : 3 multi-class of labels
The implementation here allows me to have output sequences in the form of 1 vector [matrix of N*1]. I guess it is because I am using only one softmax layer. Is there any way to work with 3 softmax layers in the output or any other solution to generate 3 multi-class of labels ?
layers = [ ...
sequenceInputLayer(numFeatures)
bilstmLayer(numHiddenUnits,'OutputMode','sequence')
fullyConnectedLayer(numClasses)
softmaxLayer
classificationLayer];

回答 (1 件)

Bhargavi Maganuru
Bhargavi Maganuru 2020 年 7 月 6 日
Hi,
If you need multi-class label, you can specify numClasses and include a fully connected layer of size numClasses. As the last layer is a ClassificationLayer, the ouput will be in the form Nx1 vector, where each value represents the class to which it belongs.

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by