When we create an LSTM
layer in matlab then we specify numHiddenUnits
as layer = lstmLayer(numHiddenUnits)
. I have two questions about it.
(1) : What is mean by numHiddenUnits
?
Does it represent the number of LSTM
cells? If yes then are these cells connected serially or parallel(having no interaction between them).
Unfortunately, there is no way to visualize the (RNN)network. I understand how one LSTM cell works but i have no idea how the following architecture looks like.
My networks is made up of these layers.
layers = [ ...
sequenceInputLayer(numFeatures)
lstmLayer(numHiddenUnits)
fullyConnectedLayer(numResponses)
regressionLayer];
(2): How does this architecture looks like?
My approach: I tried to sketch it and i think it should look like this.
numHiddenUnits
is the dimensionality of the LSTM hidden state. For instance, if you set numHiddenUnits = 5
, then the LSTM output is a 5-dimensional vector. So, it doesn't represent the number of LSTM cells.
This tutorial would help you to understand your model better. Your model works like this: At each time LSTM receives an input and processes it BUT doesn't output until the last time step. At the last time-step, your LSTM outputs a vector and sends it to the fully-connected layer and gives you the regression value. Your sketch would be ok if only your last LSTM cell sends an output to the fully-connected layer, not all of them.
Hope this helps