Docsity

deep learning - adaptive, Schemi e mappe concettuali di Informatica Industriale

Anteprima parziale del testo

Scarica deep learning - adaptive e più Schemi e mappe concettuali in PDF di Informatica Industriale solo su Docsity!

Deep Learning

Ian Goodfellow

Yoshua Bengio

Aaron Courville

Contents

Website viii

Acknowledgments ix

  • 1 Introduction Notation xiii
    • 1.1 Who Should Read This Book?
    • 1.2 Historical Trends in Deep Learning
  • I Applied Math and Machine Learning Basics
  • 2 Linear Algebra
    • 2.1 Scalars, Vectors, Matrices and Tensors
    • 2.2 Multiplying Matrices and Vectors
    • 2.3 Identity and Inverse Matrices
    • 2.4 Linear Dependence and Span
    • 2.5 Norms
    • 2.6 Special Kinds of Matrices and Vectors
    • 2.7 Eigendecomposition
    • 2.8 Singular Value Decomposition
    • 2.9 The Moore-Penrose Pseudoinverse
    • 2.10 The Trace Operator
    • 2.11 The Determinant
    • 2.12 Example: Principal Components Analysis
  • 3 Probability and Information Theory
    • 3.1 Why Probability?
    • 3.2 Random Variables CONTENTS
    • 3.3 Probability Distributions
    • 3.4 Marginal Probability
    • 3.5 Conditional Probability
    • 3.6 The Chain Rule of Conditional Probabilities
    • 3.7 Independence and Conditional Independence
    • 3.8 Expectation, Variance and Covariance
    • 3.9 Common Probability Distributions
    • 3.10 Useful Properties of Common Functions
    • 3.11 Bayes’ Rule
    • 3.12 Technical Details of Continuous Variables
    • 3.13 Information Theory
    • 3.14 Structured Probabilistic Models
  • 4 Numerical Computation
    • 4.1 Overflow and Underflow
    • 4.2 Poor Conditioning
    • 4.3 Gradient-Based Optimization
    • 4.4 Constrained Optimization
    • 4.5 Example: Linear Least Squares
  • 5 Machine Learning Basics
    • 5.1 Learning Algorithms
    • 5.2 Capacity, Overfitting and Underfitting
    • 5.3 Hyperparameters and Validation Sets
    • 5.4 Estimators, Bias and Variance
    • 5.5 Maximum Likelihood Estimation
    • 5.6 Bayesian Statistics
    • 5.7 Supervised Learning Algorithms
    • 5.8 Unsupervised Learning Algorithms
    • 5.9 Stochastic Gradient Descent
    • 5.10 Building a Machine Learning Algorithm
    • 5.11 Challenges Motivating Deep Learning
  • II Deep Networks: Modern Practices
  • 6 Deep Feedforward Networks
    • 6.1 Example: Learning XOR
    • 6.2 Gradient-Based Learning
    • 6.3 Hidden Units CONTENTS
    • 6.4 Architecture Design
      • Algorithms 6.5 Back-Propagation and Other Differentiation
    • 6.6 Historical Notes
  • 7 Regularization for Deep Learning
    • 7.1 Parameter Norm Penalties
    • 7.2 Norm Penalties as Constrained Optimization
    • 7.3 Regularization and Under-Constrained Problems
    • 7.4 Dataset Augmentation
    • 7.5 Noise Robustness
    • 7.6 Semi-Supervised Learning
    • 7.7 Multitask Learning
    • 7.8 Early Stopping
    • 7.9 Parameter Tying and Parameter Sharing
    • 7.10 Sparse Representations
    • 7.11 Bagging and Other Ensemble Methods
    • 7.12 Dropout
    • 7.13 Adversarial Training
      • Tangent Classifier 7.14 Tangent Distance, Tangent Prop and Manifold
  • 8 Optimization for Training Deep Models
    • 8.1 How Learning Differs from Pure Optimization
    • 8.2 Challenges in Neural Network Optimization
    • 8.3 Basic Algorithms
    • 8.4 Parameter Initialization Strategies
    • 8.5 Algorithms with Adaptive Learning Rates
    • 8.6 Approximate Second-Order Methods
    • 8.7 Optimization Strategies and Meta-Algorithms
  • 9 Convolutional Networks
    • 9.1 The Convolution Operation
    • 9.2 Motivation
    • 9.3 Pooling
    • 9.4 Convolution and Pooling as an Infinitely Strong Prior
    • 9.5 Variants of the Basic Convolution Function
    • 9.6 Structured Outputs
    • 9.7 Data Types
    • 9.8 Efficient Convolution Algorithms CONTENTS
    • 9.9 Random or Unsupervised Features
      • Networks 9.10 The Neuroscientific Basis for Convolutional
    • 9.11 Convolutional Networks and the History of Deep Learning
  • 10 Sequence Modeling: Recurrent and Recursive Nets
    • 10.1 Unfolding Computational Graphs
    • 10.2 Recurrent Neural Networks
    • 10.3 Bidirectional RNNs
      • Architectures 10.4 Encoder-Decoder Sequence-to-Sequence
    • 10.5 Deep Recurrent Networks
    • 10.6 Recursive Neural Networks
    • 10.7 The Challenge of Long-Term Dependencies
    • 10.8 Echo State Networks
      • Time Scales 10.9 Leaky Units and Other Strategies for Multiple
    • 10.10 The Long Short-Term Memory and Other Gated RNNs
    • 10.11 Optimization for Long-Term Dependencies
    • 10.12 Explicit Memory
  • 11 Practical Methodology
    • 11.1 Performance Metrics
    • 11.2 Default Baseline Models
    • 11.3 Determining Whether to Gather More Data
    • 11.4 Selecting Hyperparameters
    • 11.5 Debugging Strategies
    • 11.6 Example: Multi-Digit Number Recognition
  • 12 Applications
    • 12.1 Large-Scale Deep Learning
    • 12.2 Computer Vision
    • 12.3 Speech Recognition
    • 12.4 Natural Language Processing
    • 12.5 Other Applications
  • III Deep Learning Research CONTENTS
  • 13 Linear Factor Models
    • 13.1 Probabilistic PCA and Factor Analysis
    • 13.2 Independent Component Analysis (ICA)
    • 13.3 Slow Feature Analysis
    • 13.4 Sparse Coding
    • 13.5 Manifold Interpretation of PCA
  • 14 Autoencoders
    • 14.1 Undercomplete Autoencoders
    • 14.2 Regularized Autoencoders
    • 14.3 Representational Power, Layer Size and Depth
    • 14.4 Stochastic Encoders and Decoders
    • 14.5 Denoising Autoencoders
    • 14.6 Learning Manifolds with Autoencoders
    • 14.7 Contractive Autoencoders
    • 14.8 Predictive Sparse Decomposition
    • 14.9 Applications of Autoencoders
  • 15 Representation Learning
    • 15.1 Greedy Layer-Wise Unsupervised Pretraining
    • 15.2 Transfer Learning and Domain Adaptation
    • 15.3 Semi-Supervised Disentangling of Causal Factors
    • 15.4 Distributed Representation
    • 15.5 Exponential Gains from Depth
    • 15.6 Providing Clues to Discover Underlying Causes
  • 16 Structured Probabilistic Models for Deep Learning
    • 16.1 The Challenge of Unstructured Modeling
    • 16.2 Using Graphs to Describe Model Structure
    • 16.3 Sampling from Graphical Models
    • 16.4 Advantages of Structured Modeling
    • 16.5 Learning about Dependencies
    • 16.6 Inference and Approximate Inference
      • Probabilistic Models 16.7 The Deep Learning Approach to Structured
  • 17 Monte Carlo Methods
    • 17.1 Sampling and Monte Carlo Methods
    • 17.2 Importance Sampling CONTENTS
    • 17.3 Markov Chain Monte Carlo Methods
    • 17.4 Gibbs Sampling
      • Modes 17.5 The Challenge of Mixing between Separated
  • 18 Confronting the Partition Function
    • 18.1 The Log-Likelihood Gradient
    • 18.2 Stochastic Maximum Likelihood and Contrastive Divergence
    • 18.3 Pseudolikelihood
    • 18.4 Score Matching and Ratio Matching
    • 18.5 Denoising Score Matching
    • 18.6 Noise-Contrastive Estimation
    • 18.7 Estimating the Partition Function
  • 19 Approximate Inference
    • 19.1 Inference as Optimization
    • 19.2 Expectation Maximization
    • 19.3 MAP Inference and Sparse Coding
    • 19.4 Variational Inference and Learning
    • 19.5 Learned Approximate Inference
  • 20 Deep Generative Models
    • 20.1 Boltzmann Machines
    • 20.2 Restricted Boltzmann Machines
    • 20.3 Deep Belief Networks
    • 20.4 Deep Boltzmann Machines
    • 20.5 Boltzmann Machines for Real-Valued Data
    • 20.6 Convolutional Boltzmann Machines
    • 20.7 Boltzmann Machines for Structured or Sequential Outputs
    • 20.8 Other Boltzmann Machines
    • 20.9 Back-Propagation through Random Operations
    • 20.10 Directed Generative Nets
    • 20.11 Drawing Samples from Autoencoders
    • 20.12 Generative Stochastic Networks
    • 20.13 Other Generation Schemes
    • 20.14 Evaluating Generative Models
    • 20.15 Conclusion
  • Bibliography

CONTENTS

Index 773

vii

Acknowledgments

This book would not have been possible without the contributions of many people.

We would like to thank those who commented on our proposal for the book

and helped plan its contents and organization: Guillaume Alain, Kyunghyun Cho,

Çağlar Gülçehre, David Krueger, Hugo Larochelle, Razvan Pascanu and Thomas

Rohée.

We would like to thank the people who offered feedback on the content of the

book itself. Some offered feedback on many chapters: Martín Abadi, Ishaq Aden-Ali,

Guillaume Alain, Ion Androutsopoulos, Laura Ball, Fred Bertsch, Olexa Bilaniuk,

Ufuk Can Biçici, Matko Bošnjak, John Boersma, François Brault, Greg Brockman,

Alexandre de Brébisson, Pierre Luc Carrier, Sarath Chandar, Pawel Chilinski,

Mark Daoust, Oleg Dashevskii, Laurent Dinh, Stephan Dreseitl, Gudmundur

Einarsson, Hannes von Essen, Jim Fan, Miao Fan, Meire Fortunato, Frédéric

Francis, Nando de Freitas, Çağlar Gülçehre, Jurgen Van Gael, Yaroslav Ganin,

Javier Alonso García, Aydin Gerek, Stefan Heil, Jonathan Hunt, Gopi Jeyaram,

Chingiz Kabytayev, Lukasz Kaiser, Varun Kanade, Asifullah Khan, Akiel Khan,

John King, Diederik P. Kingma, Dominik Laupheimer, Yann LeCun, Minh Lê, Max

Marion, Rudolf Mathey, Matías Mattamala, Abhinav Maurya, Vincent Michalski,

Kevin Murphy, Oleg Mürk, Hung Ngo, Roman Novak, Augustus Q. Odena, Simon

Pavlik, Karl Pichotta, Eddie Pierce, Kari Pulli, Roussel Rahman, Tapani Raiko,

Anurag Ranjan, Johannes Roith, Mihaela Rosca, Halis Sak, César Salgado, Grigory

Sapunov, Yoshinori Sasaki, Mike Schuster, Julian Serban, Nir Shabat, Ken Shirriff,

Andre Simpelo, Scott Stanley, David Sussillo, Ilya Sutskever, Carles Gelada Sáez,

Graham Taylor, Valentin Tolmer, Massimiliano Tomassoli, An Tran, Shubhendu

Trivedi, Alexey Umnov, Vincent Vanhoucke, Robert Viragh, Marco Visentini-

Scarzanella, Martin Vita, David Warde-Farley, Dustin Webb, Shan-Conrad Wolf,

Kelvin Xu, Wei Xue, Ke Yang, Li Yao, Zygmunt Zając and Ozan Çağlayan.

We would also like to thank those who provided us with useful feedback on

individual chapters:

ix

CONTENTS

  • Notation: Zhang Yuanhang.

Chapter 1 Introduction, : Yusuf Akgul, Sebastien Bratieres, Samira Ebrahimi,

Charlie Gorichanaz, Benned Hedegaard, Brendan Loudermilk, Petros Mani-

atis, Eric Morris, Cosmin Pârvulescu, Muriel Rambeloarison, Alfredo Solano

and Timothy Whelan.

Chapter 2 , Linear Algebra: Amjad Almahairi, Nikola Banić, Kevin Bennett,

Philippe Castonguay, Oscar Chang, Eric Fosler-Lussier, Andrey Khalyavin,

Sergey Oreshkov, István Petrás, Dennis Prangle, Thomas Rohée, Gitanjali

Gulve Sehgal, Colby Toland, Alessandro Vitale and Bob Welland.

Chapter 3 , Probability and Information Theory: John Philip Anderson, Kai

Arulkumaran, Ana-Maria Cretu, Vincent Dumoulin, Rui Fa, Stephan Gouws,

Artem Oboturov, Patrick Pan, Antti Rasmus, Alexey Surkov and Volker

Tresp.

  • Chapter 4 , Numerical Computation: Tran Lam An, Ian Fischer, William

Gandler, Mahendra Kariya and Hu Yuhuang.

Chapter 5 , Machine Learning Basics: Dzmitry Bahdanau, Mark Cramer,

Eric Dolores, Justin Domingue, Ron Fedkiw, Nikhil Garg, Guillaume de

Laboulaye, Jon McKay, Makoto Otsuka, Bob Pepin, Philip Popien, Klaus

Radke, Emmanuel Rayner, Eric Sabo, Imran Saleh, Peter Shepard, Kee-Bong

Song, Zheng Sun, Alexandre Torres and Andy Wu.

Chapter 6 , Deep Feedforward Networks: Uriel Berdugo, Fabrizio Bottarel,

Elizabeth Burl, Ishan Durugkar, Jeff Hlywa, Jong Wook Kim, David Krueger

and Aditya Kumar Praharaj.

Chapter 7 , Regularization for Deep Learning: Brian Bartoldson, Morten

Kolbæk, Kshitij Lauria, Inkyu Lee, Sunil Mohan, Hai Phong Phan and

Joshua Salisbury.

  • Chapter 8 , Optimization for Training Deep Models: Marcel Ackermann,

Tushar Agarwal, Peter Armitage, Rowel Atienza, Andrew Brock, Max Hayden

Chiz, Gregory Galperin, Aaron Golden, Russell Howes, Hill Ma, Tegan

Maharaj, James Martens, Kashif Rasul, Thomas Stanley, Klaus Strobl,

Nicholas Turner and David Zhang.

  • Chapter 9 , Convolutional Networks: Martín Arjovsky, Eugene Brevdo, Jane

Bromley, Konstantin Divilov, Eric Jensen, Mehdi Mirza, Alex Paino, Guil-

laume Rochette, Marjorie Sayer, Ryan Stout and Wentao Wu.

x

CONTENTS

book and receive feedback and guidance from colleagues. We would especially like

to thank Ian’s former manager, Greg Corrado, and his current manager, Samy

Bengio, for their support of this project. Finally, we would like to thank Geoffrey

Hinton for encouragement when writing was difficult.

xii

Notation

This section provides a concise reference describing the notation used throughout

this book. If you are unfamiliar with any of the corresponding mathematical

concepts, we describe most of these ideas in chapters 2–4.

Numbers and Arrays

a A scalar (integer or real)

a A vector

A A matrix

A A tensor

I

n

Identity matrix with n rows and ncolumns

I Identity matrix with dimensionality implied by

context

e

( )i

Standard basis vector [0,... , 0 , 1 , 0 ,... , 0] with a

1 at position i

diag( a) A square, diagonal matrix with diagonal entries

given by a

a A scalar random variable

a A vector-valued random variable

A A matrix-valued random variable

xiii

CONTENTS

Calculus

dy

dx

Derivative of y with respect tox

∂y

∂x

Partial derivative of y with respect tox

x

y Gradient of y with respect tox

X

y Matrix derivatives of y with respect toX

X

y Tensor containing derivatives of y with respect to

X

∂f

∂x

Jacobian matrix J ∈ R

m ×n

of f : R

n

→ R

m

2

x

f ( x) or H (f )( x) The Hessian matrix of f at input point x

f ( x) dx Definite integral over the entire domain of x

S

f ( x) dx Definite integral with respect to xover the set S

Probability and Information Theory

a ⊥b The random variables a and b are independent

a ⊥b |c They are conditionally independent given c

P ( )a A probability distribution over a discrete variable

p( )a A probability distribution over a continuous vari-

able, or over a variable whose type has not been

specified

a ∼ P Random variable a has distributionP

E

x∼P

[ ( )]f x or Ef x( ) Expectation of f x( ) with respect to P ( )x

Var( ( ))f x Variance of f x( ) under P ( )x

Cov( ( )f x , g x ( )) Covariance of f x( ) and g x( ) under P ( )x

H( )x Shannon entropy of the random variable x

D

KL

( P Q ) Kullback-Leibler divergence of P and Q

N ( x μ; , Σ) Gaussian distribution over x with mean μ and

covariance Σ

xv

CONTENTS

Functions

f : A → B The function fwith domain A and rangeB

f ◦ g Composition of the functions f andg

f ( x θ; ) A function of

x parametrized by

θ

. (Sometimes

we write

f(x ) and omit the argument

θ to lighten

notation)

log x Natural logarithm ofx

σ x( ) Logistic sigmoid,

1 + exp( −x)

ζ x( ) Softplus, log(1 + exp(x))

|| x||

p

L

p

norm of x

|| x|| L

2

norm of x

x

Positive part of x, i.e., max(0 , x)

condition

is 1 if the condition is true, 0 otherwise

Sometimes we use a function f whose argument is a scalar but apply it to a

vector, matrix, or tensor: f (x), f(X ), or f ( X ). This denotes the application of f

to the array element-wise. For example, if C = σ( X ), then C i,j,k

= σ(X i,j,k

) for all

valid values of i, j and k.

Datasets and Distributions

p

data

The data generating distribution

p ˆ data

The empirical distribution defined by the training

set

X A set of training examples

x

( )i

The i-th example (input) from a dataset

y

( )i

or y

( )i

The target associated with

x

( )i

for supervised learn-

ing

X The m × n

matrix with input example x

( )i

in row

X

i,:

xvi

CHAPTER 1. INTRODUCTION

are built on top of each other, the graph is deep, with many layers. For this reason,

we call this approach to AI deep learning.

Many of the early successes of AI took place in relatively sterile and formal

environments and did not require computers to have much knowledge about

the world. For example, IBM’s Deep Blue chess-playing system defeated world

champion Garry Kasparov in 1997 ( Hsu, 2002 ). Chess is of course a very simple

world, containing only sixty-four locations and thirty-two pieces that can move

in only rigidly circumscribed ways. Devising a successful chess strategy is a

tremendous accomplishment, but the challenge is not due to the difficulty of

describing the set of chess pieces and allowable moves to the computer. Chess

can be completely described by a very brief list of completely formal rules, easily

provided ahead of time by the programmer.

Ironically, abstract and formal tasks that are among the most difficult mental

undertakings for a human being are among the easiest for a computer. Computers

have long been able to defeat even the best human chess player but only recently

have begun matching some of the abilities of average human beings to recognize

objects or speech. A person’s everyday life requires an immense amount of

knowledge about the world. Much of this knowledge is subjective and intuitive,

and therefore difficult to articulate in a formal way. Computers need to capture

this same knowledge in order to behave in an intelligent way. One of the key

challenges in artificial intelligence is how to get this informal knowledge into a

computer.

Several artificial intelligence projects have sought to hard-code knowledge

about the world in formal languages. A computer can reason automatically about

statements in these formal languages using logical inference rules. This is known as

the

knowledge base approach to artificial intelligence. None of these projects has

led to a major success. One of the most famous such projects is Cyc (Lenat and

Guha 1989, ). Cyc is an inference engine and a database of statements in a language

called CycL. These statements are entered by a staff of human supervisors. It is an

unwieldy process. People struggle to devise formal rules with enough complexity

to accurately describe the world. For example, Cyc failed to understand a story

about a person named Fred shaving in the morning ( Linde, 1992 ). Its inference

engine detected an inconsistency in the story: it knew that people do not have

electrical parts, but because Fred was holding an electric razor, it believed the

entity “FredWhileShaving” contained electrical parts. It therefore asked whether

Fred was still a person while he was shaving.

The difficulties faced by systems relying on hard-coded knowledge suggest

that AI systems need the ability to acquire their own knowledge, by extracting

2

CHAPTER 1. INTRODUCTION

patterns from raw data. This capability is known as machine learning. The

introduction of machine learning enabled computers to tackle problems involving

knowledge of the real world and make decisions that appear subjective. A simple

machine learning algorithm called logistic regression can determine whether to

recommend cesarean delivery (Mor-Yosef et al. , 1990 ). A simple machine learning

algorithm called naive Bayes can separate legitimate e-mail from spam e-mail.

The performance of these simple machine learning algorithms depends heavily

on the representation of the data they are given. For example, when logistic

regression is used to recommend cesarean delivery, the AI system does not examine

the patient directly. Instead, the doctor tells the system several pieces of relevant

information, such as the presence or absence of a uterine scar. Each piece of

information included in the representation of the patient is known as a feature

Logistic regression learns how each of these features of the patient correlates with

various outcomes. However, it cannot influence how features are defined in any

way. If logistic regression were given an MRI scan of the patient, rather than

the doctor’s formalized report, it would not be able to make useful predictions.

Individual pixels in an MRI scan have negligible correlation with any complications

that might occur during delivery.

This dependence on representations is a general phenomenon that appears

throughout computer science and even daily life. In computer science, operations

such as searching a collection of data can proceed exponentially faster if the collec-

tion is structured and indexed intelligently. People can easily perform arithmetic

on Arabic numerals but find arithmetic on Roman numerals much more time

consuming. It is not surprising that the choice of representation has an enormous

effect on the performance of machine learning algorithms. For a simple visual

example, see figure 1.1.

Many artificial intelligence tasks can be solved by designing the right set of

features to extract for that task, then providing these features to a simple machine

learning algorithm. For example, a useful feature for speaker identification from

sound is an estimate of the size of the speaker’s vocal tract. This feature gives a

strong clue as to whether the speaker is a man, woman, or child.

For many tasks, however, it is difficult to know what features should be

extracted. For example, suppose that we would like to write a program to detect

cars in photographs. We know that cars have wheels, so we might like to use the

presence of a wheel as a feature. Unfortunately, it is difficult to describe exactly

what a wheel looks like in terms of pixel values. A wheel has a simple geometric

shape, but its image may be complicated by shadows falling on the wheel, the sun

glaring off the metal parts of the wheel, the fender of the car or an object in the

3