필터 지우기
필터 지우기

How many LSTM blocks are there in bidirectional LSTM layers?

조회 수: 3 (최근 30일)
shweta gupta
shweta gupta 2021년 6월 9일
답변: Shantanu Dixit 2023년 6월 20일
Hi,
How can i relate hidden layers with number of lstm blocks?
inputSize = 17
numHiddenUnits = 50;
numClasses = 2;
maxEpochs = 15;
miniBatchSize = 1;
layers = [ ...
sequenceInputLayer(inputSize)
bilstmLayer(numHiddenUnits,'OutputMode','last')
fullyConnectedLayer(numClasses)
softmaxLayer
classificationLayer]
options = trainingOptions('adam', ...
'ExecutionEnvironment','auto', ...
'GradientThreshold',1, ...
'MaxEpochs',maxEpochs, ...
'MiniBatchSize',miniBatchSize, ...
'SequenceLength','longest', ...
'Shuffle','never', ...
'Verbose',0, ...
'Plots','training-progress');

답변 (1개)

Shantanu Dixit
Shantanu Dixit 2023년 6월 20일
Hi Shweta,
Assuming that by hidden layers you mean numHiddenUnits, the numHiddenUnits refer to the number of LSTM blocks per direction (same for both LSTM and BiLSTM). So here the number of LSTM blocks are 50 (numHiddenUnits = 50).
Refer the documentation for lstm and bilstm layer:

태그

Community Treasure Hunt

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

Start Hunting!

Translated by