Answers.Body: <p>Depending on the context, when people use the term <em>LSTM</em>, they either refer to</p>
  <ul>
  <li>an <strong>LSTM layer</strong>,</li>
  <li>an <strong>LSTM unit</strong> (like a recurrent unit in an RNN or neuron in an MLP), or</li>
  <li>an <strong>LSTM neural network</strong> (i.e. an RNN that uses LSTM units or layers).</li>
  </ul>
  <p><a href="https://www.tensorflow.org/api_docs/python/tf/keras/layers/LSTM" rel="nofollow noreferrer">In TensorFlow</a>, an LSTM is a layer, so you can stack multiple LSTMs to create deeper architectures.</p>
  <p><a href="https://pytorch.org/docs/stable/generated/torch.nn.LSTM.html" rel="nofollow noreferrer">In PyTorch</a>, the class <code>LSTM</code> can create an LSTM layer or multiple LSTM layers stacked together. You also have an <a href="https://pytorch.org/docs/stable/generated/torch.nn.LSTMCell.html" rel="nofollow noreferrer"><code>LSTMCell</code></a>, which should be just one LSTM layer.</p>
  <p><a href="https://ai.stackexchange.com/a/18199/2444">My answer here</a> should also be useful.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-16T08:49:23.747Z
Answers.LastActivityDate: 2021-12-16T08:55:00.253Z
Answers.LastEditDate: 2021-12-16T08:55:00.253Z
Answers.UserDisplayName: nbro
Body: <p>In MLP, there are neurons that form a layer. Each hidden layer gives a vector of number that is the output of that layer.</p>
  <p>In CNN, there are kernels that form a convolutional layer. Each layer gives feature maps that are the output of that layer.</p>
  <p>In LSTM, there are cells that form a recurrent layer. Each layer gives a sequence that is the output of that layer.</p>
  <p>This is my understanding of the basic terminology regarding MLP, CNN, and LSTM.</p>
  <p>But consider the <a href="https://pytorch.org/docs/stable/generated/torch.nn.LSTM.html" rel="nofollow noreferrer">following description</a> regarding the number of layers in LSTM in PyTorch</p>
  <blockquote>
  <p>num_layers – Number of <strong>recurrent layers</strong>. E.g., setting num_layers=2
  would mean <strong>stacking two LSTMs</strong> together to form a stacked LSTM, with
  the second LSTM taking in outputs of the first LSTM and computing the
  final results. Default: 1</p>
  </blockquote>
  <p>The description uses the &quot;number of recurrent layers&quot; and the &quot;LSTM&quot; in a similar manner. How I can understand this? Is it costmary to consider a recurrent layer as an LSTM?</p>
  
Tags: <terminology><recurrent-neural-networks><long-short-term-memory>
Title: Is a recurrent layer same as LSTM or single-layered LSTM?
UserDisplayName: hanugm
ThreadText: # Is a recurrent layer same as LSTM or single-layered LSTM?
  
  (Asked by: username_0 on 2021-12-16)
  
  In MLP, there are neurons that form a layer. Each hidden layer gives a vector of number that is the output of that layer.
  
  In CNN, there are kernels that form a convolutional layer. Each layer gives feature maps that are the output of that layer.
  
  In LSTM, there are cells that form a recurrent layer. Each layer gives a sequence that is the output of that layer.
  
  This is my understanding of the basic terminology regarding MLP, CNN, and LSTM.
  
  But consider the [following description](https://pytorch.org/docs/stable/generated/torch.nn.LSTM.html) regarding the number of layers in LSTM in PyTorch
  
  > num\_layers – Number of **recurrent layers**. E.g., setting num\_layers=2
  > would mean **stacking two LSTMs** together to form a stacked LSTM, with
  > the second LSTM taking in outputs of the first LSTM and computing the
  > final results. Default: 1
  
  The description uses the "number of recurrent layers" and the "LSTM" in a similar manner. How I can understand this? Is it costmary to consider a recurrent layer as an LSTM?
  
  **Tags:** terminology, recurrent-neural-networks, long-short-term-memory
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-12-16. Score: 2 | Accepted answer
  
  Depending on the context, when people use the term *LSTM*, they either refer to
  
  * an **LSTM layer**,
  * an **LSTM unit** (like a recurrent unit in an RNN or neuron in an MLP), or
  * an **LSTM neural network** (i.e. an RNN that uses LSTM units or layers).
  
  [In TensorFlow](https://www.tensorflow.org/api_docs/python/tf/keras/layers/LSTM), an LSTM is a layer, so you can stack multiple LSTMs to create deeper architectures.
  
  [In PyTorch](https://pytorch.org/docs/stable/generated/torch.nn.LSTM.html), the class `LSTM` can create an LSTM layer or multiple LSTM layers stacked together. You also have an [`LSTMCell`](https://pytorch.org/docs/stable/generated/torch.nn.LSTMCell.html), which should be just one LSTM layer.
  
  [My answer here](https://ai.stackexchange.com/a/18199/2444) should also be useful.
  
  
  ---
  
  