2
$\begingroup$

I implemented a LSTM neural network in Pytorch. It worked but I want to know if it worked the way I guessed how it worked.

Say there's a 2-layer LSTM network with 10 units in each layer. The inputs are some sequence data Xt1, Xt2, Xt3, Xt4, Xt5.

So when the inputs are entered into the network, Xt1 will be thrown into the network first and be connected to every unit in the first layer. And it will generate 10 hidden states/10 memory cell values/10 outputs. Then the 10 hidden states, 10 memory cell values and Xt2 will be connected to the 10 units again, and generate another 10 hidden states/10 memory cell values/10 outputs and so on.

After all 5 Xt's are entered into the network, the 10 outputs from Xt5 from the first layer are then used as the inputs for the second layer. The other outputs from Xt1 to Xt4 are not used. And the the 10 outputs will be entered into the second layer one by one again. So the first from the 10 will be connected to every unit in the second layer and generate 10 hidden states/10 memory cell values/10 outputs. The 10 memory cell values/10 hidden states and the second value from the 10 will be connected and so forth?

After all these are done, only the final 10 outputs from the layer 2 will be used. Is this how the LSTM network works? Thanks.

$\endgroup$
  • $\begingroup$ Welcome to Ai,can you please go through community guidelines.For your own benefit and to us as well. $\endgroup$ – quintumnia Oct 2 '18 at 17:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.