> For the complete documentation index, see [llms.txt](https://vikram-bajaj.gitbook.io/deep-learning-specialization-coursera/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vikram-bajaj.gitbook.io/deep-learning-specialization-coursera/main-10/sequence-models/recurrent-neural-networks/long-short-term-memory-network-lstm.md).

# Long Short-Term Memory Network (LSTM)

The LSTM unit is used for the same purpose as the GRU i.e. to learn long-term dependencies, but it is more powerful than the GRU unit.

The image below shows an LSTM unit:

![](/files/-M5-0W3dhaBZY2FxMS0v)

There are 3 gates: **forget** gate, **update** gate and **output** gate.

These are the equations associated with an LSTM unit:

![](/files/-M5-0W3fulFeJij7njW0)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://vikram-bajaj.gitbook.io/deep-learning-specialization-coursera/main-10/sequence-models/recurrent-neural-networks/long-short-term-memory-network-lstm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
