This week you'll learn about Long Short-Term Memory Networks.

Image

Phineas and Ferb is a beloved cartoon that many grew up watching. Two little brothers and their marvelous technological prowess gave us a new and exciting invention in every episode! But my favorite bits of this cartoon were definitely the Evil (not so evil) Dr. Doofenshmirtz and his fights with Perry, the platypus. It was goofy and fun in every sense!

Now, even Doofenshmirtz is a genius, albeit evil. But in one of the episodes, he shows that he had bare beginnings before making his first breakthrough, "the inator." But very quickly, Doofenshmirtz showcases that had he stopped at that initial breakthrough, he would never have reached the heights of intellectual genius he has achieved at present.

Similarly, if researchers stopped at recurrent neural networks (RNNs), we would never have reached the heights sequence modeling has today. RNNs are great, but they have their flaws.

That brings us to today's spotlight: the Long Short-Term Memory (LSTM) networks.

The big picture: LSTM networks are RNNs designed to remember long-term dependencies.

How it works: LSTMs were first proposed in the 1997 paper, "Long Short-Term Memory" by Hochreiter and Schmidhuber. LSTMs are RNNs that are well-suited to model long-term dependencies. They are composed of a cell state, an input gate, an output gate, and a forget gate. These three gates combine to provide a better sequence modeling algorithm than RNNs, which help build improved sequence token dependencies.

Our thoughts: Understanding how the three gates work is the key to unlocking the secret of LSTMs and their successes.

Yes, but: These gates also bring in additional complexities, which increase the training time for LSTMs. So don't consider LSTMs to be the full-proof peak of sequence modeling.

Stay smart: Be extremely thorough while understanding the gates before diving into the code. Understanding LSTM will also help you understand other sequence models and their peculiarities, like gated recurrent units (GRUs). Remember, understanding LSTMs will also showcase their flaws more clearly!

Click here to read the full tutorial

Solve Your CV/DL problem this week (or weekend) with our Working Code

You can instantly access all of the code for Long Short-Term Memory Networks by joining PyImageSearch University. Get working code to

  1. Finish your project this weekend with our code
  2. Solve your thorniest coding problems at work this week to show off your expertise
  3. Publish groundbreaking research without multiple tries at coding the hard parts

Guaranteed Results: If you haven't accomplished your CV/DL goals, let us know within 30 days and get a full refund.

I want the code

Note: You may have missed this, but last Wednesday, we published a new post on Image Translation with Pix2Pix.



The PyImageSearch Team