Skip to Content
Fundamentals of Deep Learning, 2nd Edition
book

Fundamentals of Deep Learning, 2nd Edition

by Nithin Buduma, Nikhil Buduma, Joe Papa
May 2022
Intermediate to advanced content levelIntermediate to advanced
387 pages
11h 47m
English
O'Reilly Media, Inc.
Content preview from Fundamentals of Deep Learning, 2nd Edition

Chapter 9. Models for Sequence Analysis

Analyzing Variable-Length Inputs

Up until now, we’ve worked only with data with fixed sizes: images from MNIST, CIFAR-10, and ImageNet. These models are incredibly powerful, but there are many situations in which fixed-length models are insufficient. The vast majority of interactions in our daily lives require a deep understanding of sequences—whether it’s reading the morning newspaper, making a bowl of cereal, listening to the radio, watching a presentation, or deciding to execute a trade on the stock market. To adapt to variable-length inputs, we’ll have to be a little bit more clever about how we approach designing deep learning models.

Figure 9-1 illustrates how our feed-forward neural networks break when analyzing sequences. If the sequence is the same size as the input layer, the model can perform as expected. It’s even possible to deal with smaller inputs by padding zeros to the end of the input until it’s the appropriate length. However, the moment the input exceeds the size of the input layer, naively using the feed-forward network no longer works.

Feed-forward networks thrive on fixed input size problems. Zero padding can address the handling of smaller inputs, but when naively utilized, these models break when inputs exceed the fixed input size.

Figure 9-1. Broken feed-forward network

Not all hope is lost, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Generative Deep Learning, 2nd Edition

Generative Deep Learning, 2nd Edition

David Foster
Math for Deep Learning

Math for Deep Learning

Ronald T. Kneusel
Grokking Deep Learning

Grokking Deep Learning

Andrew W. Trask

Publisher Resources

ISBN: 9781492082170Errata PageSupplemental Content