Skip to main content

(ebook) deep learning: a visual approach by glassner, andrew isbn 9781718500723, 9781718500730, 1718

Page 1

Instant Ebook Access, One Click Away – Begin at ebooknice.com

(Ebook) Deep Learning: A Visual Approach by Glassner, Andrew ISBN 9781718500723, 9781718500730, 1718500726, 1718500734, 2020047326, 2020047327 https://ebooknice.com/product/deep-learning-a-visualapproach-32736510

OR CLICK BUTTON DOWLOAD EBOOK

Get Instant Ebook Downloads – Browse at https://ebooknice.com


Instant digital products (PDF, ePub, MOBI) ready for you Download now and discover formats that fit your needs... Start reading on any device today!

(Ebook) Biota Grow 2C gather 2C cook by Loucas, Jason; Viles, James ISBN 9781459699816, 9781743365571, 9781925268492, 1459699815, 1743365578, 1925268497

https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374

ebooknice.com

(Ebook) Matematik 5000+ Kurs 2c Lärobok by Lena Alfredsson, Hans Heikne, Sanna Bodemyr ISBN 9789127456600, 9127456609

https://ebooknice.com/product/matematik-5000-kurs-2c-larobok-23848312

ebooknice.com

(Ebook) SAT II Success MATH 1C and 2C 2002 (Peterson's SAT II Success) by Peterson's ISBN 9780768906677, 0768906679

https://ebooknice.com/product/sat-ii-success-math-1c-and-2c-2002-peterson-s-satii-success-1722018

ebooknice.com

(Ebook) Master SAT II Math 1c and 2c 4th ed (Arco Master the SAT Subject Test: Math Levels 1 & 2) by Arco ISBN 9780768923049, 0768923042

https://ebooknice.com/product/master-sat-ii-math-1c-and-2c-4th-ed-arco-masterthe-sat-subject-test-math-levels-1-2-2326094

ebooknice.com


(Ebook) Cambridge IGCSE and O Level History Workbook 2C - Depth Study: the United States, 1919-41 2nd Edition by Benjamin Harrison ISBN 9781398375147, 9781398375048, 1398375144, 1398375047 https://ebooknice.com/product/cambridge-igcse-and-o-level-historyworkbook-2c-depth-study-the-united-states-1919-41-2nd-edition-53538044

ebooknice.com

(Ebook) Deep Learning, Vol. 2: From Basics to Practice by Andrew Glassner

https://ebooknice.com/product/deep-learning-vol-2-from-basics-topractice-7263814

ebooknice.com

(Ebook) Deep Learning, Vol. 1: From Basics to Practice by Andrew Glassner

https://ebooknice.com/product/deep-learning-vol-1-from-basics-topractice-7264422

ebooknice.com

(Ebook) Deep Learning, Vol. 1: From Basics to Practice by Andrew Glassner

https://ebooknice.com/product/deep-learning-vol-1-from-basics-topractice-7272326

ebooknice.com

(Ebook) Processing for Visual Artists: How to Create Expressive Images and Interactive Art by Andrew Glassner ISBN 9781138460850, 1138460850

https://ebooknice.com/product/processing-for-visual-artists-how-to-createexpressive-images-and-interactive-art-10870702

ebooknice.com


CONTENTS IN DETAIL

TITLE PAGE COPYRIGHT DEDICATION ABOUT THE AUTHOR ACKNOWLEDGMENTS INTRODUCTION Who This Book Is For This Book Has No Complex Math and No Code There Is Code, If You Want It The Figures Are Available, Too! Errata About This Book Part I: Foundational Ideas Part II: Basic Machine Learning Part III: Deep Learning Basics Part IV: Beyond the Basics Final Words

PART I: FOUNDATIONAL IDEAS


CHAPTER 1: AN OVERVIEW OF MACHINE LEARNING Expert Systems Supervised Learning Unsupervised Learning Reinforcement Learning Deep Learning Summary CHAPTER 2: ESSENTIAL STATISTICS Describing Randomness Random Variables and Probability Distributions Some Common Distributions Continuous Distributions Discrete Distributions Collections of Random Values Expected Value Dependence Independent and Identically Distributed Variables Sampling and Replacement Selection with Replacement Selection Without Replacement Bootstrapping Covariance and Correlation Covariance Correlation Statistics Don’t Tell Us Everything High-Dimensional Spaces Summary


CHAPTER 3: MEASURING PERFORMANCE Different Types of Probability Dart Throwing Simple Probability Conditional Probability Joint Probability Marginal Probability Measuring Correctness Classifying Samples The Confusion Matrix Characterizing Incorrect Predictions Measuring Correct and Incorrect Accuracy Precision Recall Precision-Recall Tradeoff Misleading Measures f1 Score About These Terms Other Measures Constructing a Confusion Matrix Correctly Summary CHAPTER 4: BAYES’ RULE Frequentist and Bayesian Probability The Frequentist Approach The Bayesian Approach Frequentists vs. Bayesians


Frequentist Coin Flipping Bayesian Coin Flipping A Motivating Example Picturing the Coin Probabilities Expressing Coin Flips as Probabilities Bayes’ Rule Discussion of Bayes’ Rule Bayes’ Rule and Confusion Matrices Repeating Bayes’ Rule The Posterior-Prior Loop The Bayes Loop in Action Multiple Hypotheses Summary CHAPTER 5: CURVES AND SURFACES The Nature of Functions The Derivative Maximums and Minimums Tangent Lines Finding Minimums and Maximums with Derivatives The Gradient Water, Gravity, and the Gradient Finding Maximums and Minimums with Gradients Saddle Points Summary CHAPTER 6: INFORMATION THEORY Surprise and Context


Understanding Surprise Unpacking Context Measuring Information Adaptive Codes Speaking Morse Customizing Morse Code Entropy Cross Entropy Two Adaptive Codes Using the Codes Cross Entropy in Practice Kullback–Leibler Divergence Summary

PART II: BASIC MACHINE LEARNING CHAPTER 7: CLASSIFICATION Two-Dimensional Binary Classification 2D Multiclass Classification Multiclass Classification One-Versus-Rest One-Versus-One Clustering The Curse of Dimensionality Dimensionality and Density High-Dimensional Weirdness Summary


CHAPTER 8: TRAINING AND TESTING Training Testing the Performance Test Data Validation Data Cross-Validation k-Fold Cross-Validation Summary CHAPTER 9: OVERFITTING AND UNDERFITTING Finding a Good Fit Overfitting Underfitting Detecting and Addressing Overfitting Early Stopping Regularization Bias and Variance Matching the Underlying Data High Bias, Low Variance Low Bias, High Variance Comparing Curves Fitting a Line with Bayes’ Rule Summary CHAPTER 10: DATA PREPARATION Basic Data Cleaning The Importance of Consistency Types of Data


One-Hot Encoding Normalizing and Standardizing Normalization Standardization Remembering the Transformation Types of Transformations Slice Processing Samplewise Processing Featurewise Processing Elementwise Processing Inverse Transformations Information Leakage in Cross-Validation Shrinking the Dataset Feature Selection Dimensionality Reduction Principal Component Analysis PCA for Simple Images PCA for Real Images Summary CHAPTER 11: CLASSIFIERS Types of Classifiers k-Nearest Neighbors Decision Trees Using Decision Trees Overfitting Trees Splitting Nodes


Support Vector Machines The Basic Algorithm The SVM Kernel Trick Naive Bayes Comparing Classifiers Summary CHAPTER 12: ENSEMBLES Voting Ensembles of Decision Trees Bagging Random Forests Extra Trees Boosting Summary

PART III: DEEP LEARNING BASICS CHAPTER 13: NEURAL NETWORKS Real Neurons Artificial Neurons The Perceptron Modern Artificial Neurons Drawing the Neurons Feed-Forward Networks Neural Network Graphs Initializing the Weights Deep Networks


Fully Connected Layers Tensors Preventing Network Collapse Activation Functions Straight-Line Functions Step Functions Piecewise Linear Functions Smooth Functions Activation Function Gallery Comparing Activation Functions Softmax Summary CHAPTER 14: BACKPROPAGATION A High-Level Overview of Training Punishing Error A Slow Way to Learn Gradient Descent Getting Started Backprop on a Tiny Neural Network Finding Deltas for the Output Neurons Using Deltas to Change Weights Other Neuron Deltas Backprop on a Larger Network The Learning Rate Building a Binary Classifier Picking a Learning Rate An Even Smaller Learning Rate


Summary CHAPTER 15: OPTIMIZERS Error as a 2D Curve Adjusting the Learning Rate Constant-Sized Updates Changing the Learning Rate over Time Decay Schedules Updating Strategies Batch Gradient Descent Stochastic Gradient Descent Mini-Batch Gradient Descent Gradient Descent Variations Momentum Nesterov Momentum Adagrad Adadelta and RMSprop Adam Choosing an Optimizer Regularization Dropout Batchnorm Summary

PART IV: BEYOND THE BASICS CHAPTER 16: CONVOLUTIONAL NEURAL NETWORKS Introducing Convolution


Detecting Yellow Weight Sharing Larger Filters Filters and Features Padding Multidimensional Convolution Multiple Filters Convolution Layers 1D Convolution 1×1 Convolutions Changing Output Size Pooling Striding Transposed Convolution Hierarchies of Filters Simplifying Assumptions Finding Face Masks Finding Eyes, Noses, and Mouths Applying Our Filters Summary CHAPTER 17: CONVNETS IN PRACTICE Categorizing Handwritten Digits VGG16 Visualizing Filters, Part 1 Visualizing Filters, Part 2 Adversaries Summary


CHAPTER 18: AUTOENCODERS Introduction to Encoding Lossless and Lossy Encoding Blending Representations The Simplest Autoencoder A Better Autoencoder Exploring the Autoencoder A Closer Look at the Latent Variables The Parameter Space Blending Latent Variables Predicting from Novel Input Convolutional Autoencoders Blending Latent Variables Predicting from Novel Input Denoising Variational Autoencoders Distribution of Latent Variables Variational Autoencoder Structure Exploring the VAE Working with the MNIST Samples Working with Two Latent Variables Producing New Input Summary CHAPTER 19: RECURRENT NEURAL NETWORKS Working with Language Common Natural Language Processing Tasks


Transforming Text into Numbers Fine-Tuning and Downstream Networks Fully Connected Prediction Testing Our Network Why Our Network Failed Recurrent Neural Networks Introducing State Rolling Up Our Diagram Recurrent Cells in Action Training a Recurrent Neural Network Long Short-Term Memory and Gated Recurrent Networks Using Recurrent Neural Networks Working with Sunspot Data Generating Text Different Architectures Seq2Seq Summary CHAPTER 20: ATTENTION AND TRANSFORMERS Embedding Embedding Words ELMo Attention A Motivating Analogy Self-Attention Q/KV Attention Multi-Head Attention Layer Icons


Transformers Skip Connections Norm-Add Positional Encoding Assembling a Transformer Transformers in Action BERT and GPT-2 BERT GPT-2 Generators Discussion Data Poisoning Summary CHAPTER 21: REINFORCEMENT LEARNING Basic Ideas Learning a New Game The Structure of Reinforcement Learning Step 1: The Agent Selects an Action Step 2: The Environment Responds Step 3: The Agent Updates Itself Back to the Big Picture Understanding Rewards Flippers L-Learning The Basics The L-Learning Algorithm Testing Our Algorithm Handling Unpredictability


Q-Learning Q-Values and Updates Q-Learning Policy Putting It All Together The Elephant in the Room Q-learning in Action SARSA The Algorithm SARSA in Action Comparing Q-Learning and SARSA The Big Picture Summary CHAPTER 22: GENERATIVE ADVERSARIAL NETWORKS Forging Money Learning from Experience Forging with Neural Networks A Learning Round Why Adversarial? Implementing GANs The Discriminator The Generator Training the GAN GANs in Action Building a Discriminator and Generator Training Our Network Testing Our Network


DCGANs Challenges Using Big Samples Modal Collapse Training with Generated Data Summary CHAPTER 23: CREATIVE APPLICATIONS Deep Dreaming Stimulating Filters Running Deep Dreaming Neural Style Transfer Representing Style Representing Content Style and Content Together Running Style Transfer Generating More of This Book Summary Final Thoughts REFERENCES Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7


Chapter 8 Chapter 9 Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14 Chapter 15 Chapter 16 Chapter 17 Chapter 18 Chapter 19 Chapter 20 Chapter 21 Chapter 22 Chapter 23 IMAGE CREDITS Chapter 1 Chapter 10 Chapter 16 Chapter 17 Chapter 18 Chapter 23 INDEX


DEEP LEARNING A Visual Approach Andrew Glassner

San Francisco


DEEP LEARNING: A VISUAL APPROACH. Copyright © 2021 by Andrew Glassner. All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN-13: 978-1-7185-0072-3 (print) ISBN-13: 978-1-7185-0073-0 (ebook) Publisher: William Pollock Executive Editor: Barbara Yien Production Editors: Maureen Forys and Rachel Monaghan Developmental Editor: Alex Freed Cover and Interior Design: Octopod Studios Cover Illustrator: Gina Redman Technical Reviewers: George Hosu and Ron Kneusel Copyeditor: Rebecca Rider Compositor: Maureen Forys, Happenstance Type-O-Rama Proofreader: James Fraleigh With the exception of the images noted at the end of the book in the Image Credits, all the images in this book are produced by the author. All original images may be freely downloaded from https://github.com/blueberrymusic and used as the reader pleases. For information on book distributors or translations, please contact No Starch Press, Inc. directly: No Starch Press, Inc. 245 8th Street, San Francisco, CA 94103 phone: 1-415-863-9900; info@nostarch.com www.nostarch.com

Library of Congress Cataloging-in-Publication Data Names: Glassner, Andrew S., author. Title: Deep learning : a visual approach / Andrew Glassner. Description: San Francisco, CA : No Starch Press, Inc., [2021] | Includes bibliographical references and index. Identifiers: LCCN 2020047326 (print) | LCCN 2020047327 (ebook) | ISBN 9781718500723 (paperback) | ISBN 9781718500730 (ebook) Subjects: LCSH: Machine learning. | Neural networks. Classification: LCC Q325.5 .G58 2021 (print) | LCC Q325.5 (ebook) | DDC 006.3/1--dc23 LC record available at https://lccn.loc.gov/2020047326 LC ebook record available at https://lccn.loc.gov/2020047327

No Starch Press and the No Starch Press logo are registered trademarks of No Starch Press, Inc. Other product and company names mentioned herein may be


the trademarks of their respective owners. Rather than use a trademark symbol with every occurrence of a trademarked name, we are using the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The information in this book is distributed on an “As Is” basis, without warranty. While every precaution has been taken in the preparation of this work, neither the author nor No Starch Press, Inc. shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in it.


For Niko, who’s always there with a smile, a paw, and a wag.


About the Author Dr. Andrew Glassner is a Senior Research Scientist at Weta Digital, where he uses deep learning to help artists produce visual effects for film and television. He was Technical Papers Chair for SIGGRAPH ’94, Founding Editor of the Journal of Computer Graphics Tools, and Editor-in-Chief of ACM Transactions on Graphics. His prior books include the Graphics Gems series and the textbook Principles of Digital Image Synthesis. Glassner holds a PhD from UNC-Chapel Hill. He paints, plays jazz piano, and writes novels. His website is www.glassner.com, and he can be followed on Twitter as @AndrewGlassner.

About the Technical Reviewers George Hosu is a software engineer and world traveler with a broad interest in statistics and machine learning. He works as the lead machine learning engineer on an autoML and “explainable AI” project called Mindsdb. In his spare time, he writes to strengthen his understanding of epistemology, ML, and classical mathematics, and how they all come together to generate a meaningful map of the world. You can find his writing at https://blog.cerebralab.com/. Ron Kneusel has been working with machine learning in industry since 2003 and completed a PhD in machine learning from the University of Colorado, Boulder, in 2016. Ron currently works for L3Harris Technologies, Inc. He has two books available from Springer: Numbers and Computers, and Random Numbers and Computers.


ACKNOWLEDGMENTS

Authors like to say that nobody writes a book alone. We say that because it’s true. It gives me great pleasure to thank my friends and colleagues who helped me make this book possible. For their consistent and enthusiastic support of this project, and for helping me feel good about it all the way through, I am enormously grateful to Eric Braun, Steven Drucker, Eric Haines, and Morgan McGuire. Thanks also to Georgia, Jenn, and Michael Ambrose for always providing cheerful conversation after I’d spent too long at the computer. Thanks to the reviewers of this book’s first edition, whose generous and insightful comments greatly improved the presentation: Adam Finkelstein, Alex Colburn, Alyn Rockwood, Angelo Pesce, Barbara Mones, Brian Wyvill, Craig Kaplan, Doug Roble, Eric Braun, Greg Turk, Jeff Hultquist, Kristi Morton, Lesley Istead, Matt Pharr, Mike Tyka, Morgan McGuire, Paul Beardsley, Paul Strauss, Peter Shirley, Philipp Slusallek, Serban Porumbescu, Stefanus Du Toit, Steven Drucker, Wenhao Yu, and Zackory Erickson. Special thanks to super reviewers Alexander Keller, Eric Haines, Jessica Hodgins, and Luis Alvarado, who read the whole first edition and offered wonderful feedback on both presentation and structure. Thank you to technical reviewers George Hosu and Ron Kneusel for their insights. Thanks to Todd Szymanski for advice on the design and layout of the book’s first edition and to Morgan McGuire for the Markdeep layout system, which enabled me to focus on writing and not word processing mechanics.


Thank you to the wonderful folks at No Starch Press for taking on this large project. Giant thanks to my editor Alex Freed, who read through the entire manuscript and offered numerous insightful comments and suggestions that greatly improved it throughout. Thank you to copyeditor Rebecca Rider and production editor Maureen Forys. Thank you to Rachel Monaghan for shepherding this project to completion with skill and grace. Thanks to publisher Bill Pollock for believing in the book and supporting the process. My terrific colleagues at Weta Digital, Ltd. gave me professional and personal support and encouragement as I tackled this second edition. Thank you to Antoine Bouthors, Jedrzej Wojtowicz, Joe Letteri, Luca Fascione, Millie Maier, Navi Brouwer, Tom Buys, and Yann Provencher.


INTRODUCTION

Imagine that you’re rubbing a golden lamp. You say, “Genie, for my three wishes, give me someone to love, great wealth, and a long and healthy life.” Now imagine that you’re entering your home. You say, “House, bring the car around, ask Sarah if she’s free for lunch, schedule a haircut, and make me a latte. Oh, and play some Thelonious Monk, please.” In both of these situations, you’re asking a disembodied being of great power to hear you, understand you, and fulfill your desires. The first scenario is a fantasy going back millennia. The second scenario is commonplace reality today, thanks to artificial intelligence, or AI. How did we invent these magic genies? The revolution in AI that’s changing the world today is the result of three developments. First, computers are getting bigger and faster every year, and special-purpose chips originally intended for generating images are now powering AI techniques as well. Second, people keep developing new algorithms. Surprisingly, some of the algorithms powering AI today have been around for decades. They were more powerful than anyone knew and were just waiting for enough data and compute power to let them shine. Newer and even more powerful algorithms are now pushing the field forward at an increasingly rapid pace. Some of the most powerful algorithms


used today belong to a category of AI called deep learning, and those are the techniques we’ll emphasize in this book. Third, and perhaps most critically, there are now massive databases for these algorithms to learn from. Social networks, streaming services, governments, credit card agencies, and even supermarkets measure and retain every crumb of information they can gather. Public data on the web is also vast. As of late 2020, estimates suggest there are more than 4 billion hours of video freely available online, over 17 billion images, and an untold amount of text covering topics from sports history to weather patterns to municipal records. In practice, these databases are often seen as the most valuable component of any new machine learning system. After all, anyone with money can buy computers, and the algorithms they run are almost all publicly available in research journals, books, and open source repositories. It’s the data that organizations jealously hoard, to use for themselves, or to sell to the highest bidder. It’s no stretch to say that databases are the new oil, the new gold. Like any radical technology, AI has its rosy cheerleaders who foresee great advantages for the human race and dour predictors of doom who see nothing but ruin and the destruction of the societies and cultures that make up our world. Who is right? How can we judge the risks and rewards of this new technology? When should we embrace AI and when should we forbid it? The best way to thoughtfully deal with a new technology is to understand it. When we know how it works, and the nature of its powers and limitations, we can determine where and how it should be used to create a future we want to inhabit. This book exists to help you understand what deep learning is and how it works. When you know the strengths and weaknesses of deep learning, you’ll be in a better position to use it for your own work and understand its actual and potential impacts on our cultures and societies. It will also help you see when people and organizations that hold power are using these tools, and then determine for yourself whether they’re using them for your advantage, or their own.


Who This Book Is For I wrote this book for anyone who’s interested in how deep learning works. You don’t need math or programming experience. You don’t need to be a computer whiz. You don’t have to be a technologist at all! This book is for anyone with curiosity and a desire to look behind the headlines. You may be surprised that most of the algorithms of deep learning aren’t very complicated or hard to understand. They’re usually simple and elegant and gain their power by being repeated millions of times over huge databases. In addition to satisfying pure intellectual curiosity (which I think is a fine reason to learn anything), I wrote this book for people who come face to face with deep learning, either in their own work or when interacting with others who use it. After all, one of the best reasons to understand AI is so we can use it ourselves! We can build AI systems now that help us do our work better, enjoy our hobbies more deeply, and understand the world around us more fully. If you want to know how this stuff works, you’re going to feel right at home.


This Book Has No Complex Math and No Code Everybody has their own way of learning. I wrote this book because I felt there were people who would like to understand deep learning but didn’t want to get there by studying equations or programs. So, rather than describe algorithms with equations or program listings, I use words and pictures. That doesn’t mean the descriptions are sloppy or vague. Rather, I’ve worked hard to be as clear as possible, and, when appropriate, precise. When you’re done with this book, you’ll have a solid grasp of the general principles. If you later decide that you’d like to reframe your understanding in mathematical language, or write programs with a specific computer language or library, you’ll find it much easier than starting from scratch.

There Is Code, If You Want It Although programming skills aren’t needed to read this book, translating the ideas into practice is important if you want to build and train your own systems. So, if you have that itch, I’ve provided the tools to scratch it. I’ve provided three free bonus chapters on my GitHub at https://github.com/blueberrymusic. One chapter addresses using Python’s free scikit-learn library, and the other two show how to build many of the deep learning systems we talk about in the book. With actual running code to build on and modify, you’ll be able to use existing networks or design and train your own networks for your own applications. The code is presented in the popular form of Jupyter notebooks, so it’s ready for your investigation, experimentation, adaptation, and use. All of these programs are shared under the MIT license, which means you can use them in almost any way you like.


The Figures Are Available, Too! Also on my GitHub at https://github.com/blueberrymusic you’ll find almost every figure that I drew for this book, in high-quality 300 dpi PNG format. The figures are provided under the same MIT license as the code, so you’re free to use or modify them for classes, talks, presentations, papers, or any other use where you feel one of these figures would help you out.

Errata No book of this size is going to be free of errors, from little typos to big mistakes. If you spot something that seems wrong, please let us know at errata@nostarch.com. We’ll keep a list of the confirmed corrections at https://nostarch.com/deep-learning-visual-approach.

About This Book The first part of this book covers foundational ideas from probability, statistics, and information theory that we’ll need later on. Don’t let these topic names intimidate you! We’ll be sticking to the basic and essential ideas, with almost no mathematical notation. You may be surprised at how easy some of these topics are when they’re presented in plain language and diagrams. The second part of the book covers basic machine learning concepts, including basic ideas and some classic algorithms. With that background in place, the third and fourth parts of the book are where it all comes together, and we get into deep learning itself. Here’s a brief overview of what you’ll find in each chapter.

Part I: Foundational Ideas Chapter 1: An Overview of Machine Learning. We’ll look at the big picture and set the stage for how machine learning works.


Chapter 2: Essential Statistics. A core idea in deep learning is finding patterns in data. The language of statistics allows us to identify and discuss those patterns. Chapter 3: Measuring Performance. When an algorithm answers a question, there is always some chance that answer is wrong. By carefully choosing how we measure, we can talk about what “wrong” really means. Chapter 4: Bayes’ Rule. We can discuss the likelihood that an algorithm is giving us correct results by considering both our expectations and what results we’ve seen so far. Bayes’ Rule is a powerful way to do this. Chapter 5: Curves and Surfaces. As a learning algorithm searches for patterns in data, it often makes use of abstracted curves and surfaces in imaginary spaces. To help us discuss those algorithms later in the book, here we discuss what those curves and surfaces look like. Chapter 6: Information Theory. A powerful idea used in machine learning is that we are representing and modifying information. The ideas of information theory let us quantify and measure different kinds of information.

Part II: Basic Machine Learning Chapter 7: Classification. We often want a computer to assign a specific class, or category, to a piece of data. For example, what animal is in a photo, or what word is being said into a phone? We look at the basic ideas for solving this problem. Chapter 8: Training and Testing. To build a deep learning system for use in the world, we must first train it to learn how to do what we want and then test its performance to be sure it’s doing the job well. Chapter 9: Overfitting and Underfitting. A surprising result of training a deep learning system is that it can start memorizing the


data we’re using to train it. In an apparent paradox, this makes it worse at handling new data when the algorithm is released. We’ll see where this problem comes from and how to reduce its impact. Chapter 10: Data Preparation. We train a deep learning system by providing it with lots of data to learn from. We’ll see how to prepare that data so training is as efficient as possible. Chapter 11: Classifiers. We’ll look at specific machine learning algorithms for classifying data. These are often a good way to get to know our data before investing the time and effort to train a deep learning system. Chapter 12: Ensembles. We can assemble lots of very simple learning systems into a far more powerful composite system. Sometimes many small systems can return an answer faster, and more accurately, than a single big system.

Part III: Deep Learning Basics Chapter 13: Neural Networks. We look at artificial neurons, and how to connect them together to form a network. These networks form the basis of deep learning. Chapter 14: Backpropagation. The key algorithm that makes neural networks practical is a way of training them so that they learn from data. We look closely into the first of the two algorithms that make up the learning process. Chapter 15: Optimizers. The second algorithm for training a deep network actually modifies the numbers that make up the network, improving its performance. We’ll look at a variety of ways to do this effectively.

Part IV: Beyond the Basics Chapter 16: Convolutional Neural Networks. Powerful algorithms have been developed to handle spatial data like images.


We’ll look at these algorithms and how they are used. Chapter 17: Convnets in Practice. Having covered the techniques of handling spatial data, we’ll look more closely at how we can use those techniques in practice to recognize objects. Chapter 18: Autoencoders. We can simplify huge datasets so that they’re smaller in size and easier to manage. We can also remove noise, enabling us to clean up damaged images. Chapter 19: Recurrent Neural Networks. When we work with sequences, like text and audio clips, we need special tools. We’ll see one popular class of them here. Chapter 20: Attention and Transformers. Understanding text and language is particularly important. We’ll look at algorithms originally designed to interpret and generate text, but which are proving to also be useful in other applications. Chapter 21: Reinforcement Learning. Sometimes we don’t know the answers we want the computer to provide, such as when scheduling real-world activities involving unpredictable groups of people. We’ll see how to address these kinds of problem flexibly. Chapter 22: Generative Adversarial Networks. We often want to create, or generate, new instances of the data we have, for example to create newspaper stories from raw data, or perhaps worlds for people to explore in games. We’ll look at a powerful way to train such generators. Chapter 23: Creative Applications. We wrap up with some fun, applying the tools of deep learning to make psychedelic images, apply an artist’s signature style to a photograph, and generate new text in the style of any author.

Final Words There’s a lot of material in this book!


It’s all there so that when you’re done, you’ll really know your stuff. You’ll be able to talk to other people about deep learning, sharing your insights and experience, and learn from theirs. And if you’re so motivated, you’ll be able to grab one of the many free deep learning libraries and design, train, test, and deploy your own systems for any purpose you can dream up. Deep learning is a fascinating field that combines ideas from many intellectual disciplines to build algorithms that are forcing us to ask fundamental questions about the nature of intelligence and understanding. It’s also a whole lot of fun! Welcome to the journey. You’re going to have a great time!


PART I FOUNDATIONAL IDEAS


Turn static files into dynamic content formats.

Create a flipbook