Mehta Et Al. - 2019 - A High-Bias, Low-Variance Introduction To Machine PDF
Mehta Et Al. - 2019 - A High-Bias, Low-Variance Introduction To Machine PDF
Mehta Et Al. - 2019 - A High-Bias, Low-Variance Introduction To Machine PDF
Marin Bukov
Department of Physics,
arXiv:1803.08823v3 [physics.comp-ph] 27 May 2019
University of California,
Berkeley, CA 94720,
USA†
Charles K. Fisher
Unlearn.AI, San Francisco,
CA 94108
David J. Schwab
Initiative for the Theoretical Sciences,
The Graduate Center,
City University of New York,
365 Fifth Ave., New York,
NY 10016
Machine Learning (ML) is one of the most exciting and dynamic areas of modern re-
search and application. The purpose of this review is to provide an introduction to the
core concepts and tools of machine learning in a manner easily understood and intuitive
to physicists. The review begins by covering fundamental concepts in ML and modern
statistics such as the bias-variance tradeoff, overfitting, regularization, generalization,
and gradient descent before moving on to more advanced topics in both supervised
and unsupervised learning. Topics covered in the review include ensemble models, deep
learning and neural networks, clustering and data visualization, energy-based models (in-
cluding MaxEnt models and Restricted Boltzmann Machines), and variational methods.
Throughout, we emphasize the many natural connections between ML and statistical
physics. A notable aspect of the review is the use of Python Jupyter notebooks to in-
troduce modern ML/statistical packages to readers using physics-inspired datasets (the
Ising Model and Monte-Carlo simulations of supersymmetric decays of proton-proton
collisions). We conclude with an extended outlook discussing possible uses of machine
learning for furthering our understanding of the physical world as well as open problems
in ML where physicists may be able to contribute.
X. Convolutional Neural Networks (CNNs) 56 XVII. Variational AutoEncoders (VAEs) and Generative
A. The structure of convolutional neural networks 56 Adversarial Networks (GANs) 94
B. Example: CNNs for the 2D Ising model 58 A. The limitations of maximizing Likelihood 94
C. Pre-trained CNNs and transfer learning 58 B. Generative models and adversarial learning 96
C. Variational Autoencoders (VAEs) 97
XI. High-level Concepts in Deep Neural Networks 60 1. VAEs as variational models 97
A. Organizing deep learning workflows using the 2. Training via the reparametrization trick 98
bias-variance tradeoff 60 3. Connection to the information bottleneck 99
B. Why neural networks are so successful: three D. VAE with Gaussian latent variables and Gaussian
high-level perspectives on neural networks 61 encoder 100
1. Neural networks as representation learning 61 1. Implementing the Gaussian VAE 100
2. Neural networks can exploit large amounts of 2. VAEs for the MNIST dataset 101
data 61 3. VAEs for the 2D Ising model 101
3
XVIII. Outlook 103 sity in Fall of 2016. As such, it assumes a level of familiar-
A. Research at the intersection of physics and ML 103 ity with several topics found in graduate physics curricula
B. Topics not covered in review 104
(partition functions, statistical mechanics) and a fluency
C. Rebranding Machine Learning as “Artificial
Intelligence” 105 in mathematical techniques such as linear algebra, multi-
D. Social Implications of Machine Learning 105 variate calculus, variational methods, probability theory,
and Monte-Carlo methods. It also assumes a familiar-
XIX. Acknowledgments 106
ity with basic computer programming and algorithmic
A. Overview of the Datasets used in the Review 106 design.
1. Ising dataset 106
2. SUSY dataset 106
3. MNIST Dataset 107 A. What is Machine Learning?
References 107
Most physicists learn the basics of classical statistics
early on in undergraduate laboratory courses. Classical
I. INTRODUCTION statistics is primarily concerned with how to use data
to estimate the value of an unknown quantity. For in-
Machine Learning (ML), data science, and statistics stance, estimating the speed of light using measurements
are fields that describe how to learn from, and make pre- obtained with an interferometer is one such example that
dictions about, data. The availability of big datasets is relies heavily on techniques from statistics.
a hallmark of modern science, including physics, where Machine Learning is a subfield of artificial intelligence
data analysis has become an important component of di- with the goal of developing algorithms capable of learning
verse areas, such as experimental particle physics, ob- from data automatically. In particular, an artificially in-
servational astronomy and cosmology, condensed matter telligent agent needs to be able to recognize objects in its
physics, biophysics, and quantum computing. Moreover, surroundings and predict the behavior of its environment
ML and data science are playing increasingly important in order to make informed choices. Therefore, techniques
roles in many aspects of modern technology, ranging from in ML tend to be more focused on prediction rather than
biotechnology to the engineering of self-driving cars and estimation. For example, how do we use data from the
smart devices. Therefore, having a thorough grasp of the interferometry experiment to predict what interference
concepts and tools used in ML is an important skill that pattern would be observed under a different experimental
is increasingly relevant in the physical sciences. setup? In addition, methods from ML tend to be applied
The purpose of this review is to serve as an introduc- to more complex high-dimensional problems than those
tion to foundational and state-of-the-art techniques in typically encountered in a classical statistics course.
ML and data science for physicists. The review seeks to Despite these differences, estimation and prediction
find a middle ground between a short overview and a full- problems can be cast into a common conceptual frame-
length textbook. While there exist many wonderful ML work. In both cases, we choose some observable quantity
textbooks (Abu-Mostafa et al., 2012; Bishop, 2006; Fried- x of the system we are studying (e.g., an interference pat-
man et al., 2001; Murphy, 2012), they are lengthy and use tern) that is related to some parameters θ (e.g., the speed
specialized language that is often unfamiliar to physicists. of light) of a model p(x|θ) that describes the probability
This review builds upon the considerable knowledge most of observing x given θ. Now, we perform an experiment
physicists already possess in statistical physics in order to obtain a dataset X and use these data to fit the model.
to introduce many of the major ideas and techniques Typically, “fitting” the model involves finding θ̂ that pro-
used in modern ML. We take a physics-inspired peda- vides the best explanation for the data. In the case when
gogical approach, emphasizing simple examples (e.g., re- “fitting” refers to the method of least squares, the esti-
gression and clustering), before delving into more ad- mated parameters maximize the probability of observ-
vanced topics. The intention of this review and the ing the data (i.e., θ̂ = argmaxθ {p(X|θ)}). Estimation
accompanying Jupyter notebooks (available at https: problems are concerned with the accuracy of θ̂, whereas
//physics.bu.edu/~pankajm/MLnotebooks.html) is to prediction problems are concerned with the ability of the
give the reader the requisite background knowledge to model to predict new observations (i.e., the accuracy of
follow and apply these techniques to their own areas of p(x|θ̂)). Although the goals of estimation and prediction
interest. are related, they often lead to different approaches. As
While this review is written with a physics background this review is aimed as an introduction to the concepts of
in mind, we aim for it to be useful to anyone with some ML, we will focus on prediction problems and refer the
background in statistical physics, and it is suitable for reader to one of many excellent textbooks on classical
both graduate students and researchers as well as ad- statistics for more information on estimation (Lehmann
vanced undergraduates. The review is based on an ad- and Casella, 2006; Lehmann and Romano, 2006; Wasser-
vanced topics graduate course taught at Boston Univer- man, 2013; Witte and Witte, 2013).
4
The last three decades have seen an unprecedented in- Any review on ML must simultaneously accomplish
crease in our ability to generate and analyze large data two related but distinct goals. First, it must convey the
sets. This “big data” revolution has been spurred by an rich theoretical foundations underlying modern ML. This
exponential increase in computing power and memory task is made especially difficult because ML is very broad
commonly known as Moore’s law. Computations that and interdisciplinary, drawing on ideas and intuitions
were unthinkable a few decades ago can now be routinely from many fields including statistics, computational neu-
performed on laptops. Specialized computing machines roscience, and physics. Unfortunately, this means mak-
(such as GPU-based machines) are continuing this trend ing choices about what theoretical ideas to include in the
towards cheap, large-scale computation, suggesting that review. This review emphasizes connections with sta-
the “big data” revolution is here to stay. tistical physics, physics-inspired Bayesian inference, and
This increase in our computational ability has been ac- computational neuroscience models. Thus, certain ideas
companied by new techniques for analyzing and learning (e.g., gradient descent, expectation maximization, varia-
from large datasets. These techniques draw heavily from tional methods, and deep learning and neural networks)
ideas in statistics, computational neuroscience, computer are covered extensively, while other important ideas are
science, and physics. Similar to physics, modern ML given less attention or even omitted entirely (e.g., statis-
places a premium on empirical results and intuition over tical learning, support vector machines, kernel methods,
the more formal treatments common in statistics, com- Gaussian processes). Second, any ML review must give
puter science, and mathematics. This is not to say that the reader the practical know-how to start using the tools
proofs are not important or undesirable. Rather, many and concepts of ML for practical problems. To accom-
of the advances of the last two decades – especially in plish this, we have written a series of Jupyter notebooks
fields like deep learning – do not have formal justifica- to accompany this review. These python notebooks in-
tions (much like there still exists no mathematically well- troduce the nuts-and-bolts of how to use, code, and im-
defined concept of the Feynman path-integral in d > 1). plement the methods introduced in the main text. Luck-
ily, there are numerous great ML software packages avail-
Physicists are uniquely situated to benefit from and able in Python (scikit-learn, tensorflow, Pytorch, Keras)
contribute to ML. Many of the core concepts and tech- and we have made extensive use of them. We have also
niques used in ML – such as Monte-Carlo methods, simu- made use of a new package, Paysage, for energy-based
lated annealing, variational methods – have their origins generative models which has been co-developed by one
in physics. Moreover, “energy-based models” inspired by of the authors (CKF) and maintained by Unlearn.AI (a
statistical physics are the backbone of many deep learn- company affiliated with two of the authors: CKF and
ing methods. For these reasons, there is much in modern PM). The purpose of the notebooks is to both familiarize
ML that will be familiar to physicists. physicists with these resources and to serve as a starting
Physicists and astronomers have also been at the fore- point for experimenting and playing with ideas.
front of using “big data”. For example, experiments such ML can be divided into three broad categories: super-
as CMS and ATLAS at the LHC generate petabytes of vised learning, unsupervised learning, and reinforcement
data per year. In astronomy, projects such as the Sloan learning. Supervised learning concerns learning from la-
Digital Sky Survey (SDSS) routinely analyze and release beled data (for example, a collection of pictures labeled
hundreds of terabytes of data measuring the properties of as containing a cat or not containing a cat). Common
nearly a billion stars and galaxies. Researchers in these supervised learning tasks include classification and re-
fields are increasingly incorporating recent advances in gression. Unsupervised learning is concerned with find-
ML and data science, and this trend is likely to acceler- ing patterns and structure in unlabeled data. Examples
ate in the future. of unsupervised learning include clustering, dimensional-
Besides applications to physics, part of the goal of this ity reduction, and generative modeling. Finally, in rein-
review is to serve as an introductory resource for those forcement learning an agent learns by interacting with an
looking to transition to more industry-oriented projects. environment and changing its behavior to maximize its
Physicists have already made many important contribu- reward. For example, a robot can be trained to navigate
tions to modern big data applications in an industrial in a complex environment by assigning a high reward to
setting (Metz, 2017). Data scientists and ML engineers actions that help the robot reach a desired destination.
in industry use concepts and tools developed for ML to We refer the interested reader to the classic book by Sut-
gain insight from large datasets. A familiarity with ML ton and Barto Reinforcement Learning: an Introduction
is a prerequisite for many of the most exciting employ- (Sutton and Barto, 1998). While useful, the distinction
ment opportunities in the field, and we hope this review between the three types of ML is sometimes fuzzy and
will serve as a useful introduction to ML for physicists fluid, and many applications often combine them in novel
beyond an academic setting. and interesting ways. For example, the recent success
5
of Google DeepMind in developing ML algorithms that MNIST dataset, on the other hand, introduces the fla-
excel at tasks such as playing Go and video games em- vor of present-day ML problems. By re-analyzing the
ploy deep reinforcement learning, combining reinforce- same datasets with multiple techniques, we hope readers
ment learning with supervised learning methods based will be able to get a sense of the various, inevitable trade-
on deep neural networks. offs involved in choosing how to analyze data. Certain
Here, we limit our focus to supervised and unsuper- techniques work better when data is limited while others
vised learning. The literature on reinforcement learning may be better suited to large data sets with many fea-
is extensive and uses ideas and concepts that, to a large tures. A short description of these datasets are given in
degree, are distinct from supervised and unsupervised the Appendix.
learning tasks. For this reason, to ensure cohesiveness This review draws generously on many wonderful text-
and limit the length of this review, we have chosen not books on ML and we encourage the reader to con-
to discuss reinforcement learning. However, this omis- sult them for further information. They include Abu
sion should not be mistaken for a value judgement on Mostafa’s masterful Learning from Data, which intro-
the utility of reinforcement learning for solving physical duces the basic concepts of statistical learning theory
problems. For example, some of the authors have used (Abu-Mostafa et al., 2012), the more advanced but
inspiration from reinforcement learning to tackle difficult equally good The Elements of Statistical Learning by
problems in quantum control (Bukov, 2018; Bukov et al., Hastie, Tibshirani, and Friedman (Friedman et al., 2001),
2018). Michael Nielsen’s indispensable Neural Networks and
In writing this review, we have tried to adopt a style Deep Learning which serves as a wonderful introduction
that reflects what we consider to be the best of the to the neural networks and deep learning (Nielsen, 2015)
physics tradition. Physicists understand the importance and David MacKay’s outstanding Information Theory,
of well-chosen examples for furthering our understand- Inference, and Learning Algorithms which introduced
ing. It is hard to imagine a graduate course in statistical Bayesian inference and information theory to a whole
physics without the Ising model. Each new concept that generation of physicists (MacKay, 2003). More com-
is introduced in statistical physics (mean-field theory, prehensive (and much longer) books on modern ML
transfer matrix techniques, high- and low-temperature techniques include Christopher Bishop’s classic Pattern
expansions, the renormalization group, etc.) is applied to Recognition and Machine Learning (Bishop, 2006) and
the Ising model. This allows for the progressive building the more recently published Machine Learning: A Prob-
of intuition and ultimately a coherent picture of statisti- abilistic Perspective by Kevin Murphy (Murphy, 2012).
cal physics. We have tried to replicate this pedagogical Finally, one of the great successes of modern ML is deep
approach in this review by focusing on a few well-chosen learning, and some of the pioneers of this field have writ-
techniques – linear and logistic regression in the case of ten a textbook for students and researchers entitled Deep
supervised learning and clustering in the case of unsu- Learning (Goodfellow et al., 2016). In addition to these
pervised learning – to introduce the major theoretical textbooks, we have consulted numerous research papers,
concepts. reviews, and web resources. Whenever possible, we have
In this same spirit, we have chosen three interest- tried to point the reader to key papers and other refer-
ing datasets with which to illustrate the various algo- ences that we have found useful in preparing this review.
rithms discussed here. (i) The SUSY data set consists However, we are neither capable of nor have we made any
of 5, 000, 000 Monte-Carlo samples of proton-proton col- effort to make a comprehensive review of the literature.
lisions decaying to either signal or background processes, The review is organized as follows. We begin by
which are both parametrized with 18 features. The sig- introducing polynomial regression as a simple example
nal process is the production of electrically-charged su- that highlights many of the core ideas of ML. The next
persymmetric particles, which decay to W bosons and an few chapters introduce the language and major concepts
electrically-neutral supersymmetric particle, invisible to needed to make these ideas more precise including tools
the detector, while the background processes are various from statistical learning theory such as overfitting, the
decays involving only Standard Model particles (Baldi bias-variance tradeoff, regularization, and the basics of
et al., 2014). (ii) The Ising data set consists of 104 Bayesian inference. The next chapter builds on these
states of the 2D Ising model on a 40 × 40 square lat- examples to discuss stochastic gradient descent and its
tice, obtained using Monte-Carlo (MC) sampling at a generalizations. We then apply these concepts to linear
few fixed temperatures T . (iii) The MNIST dataset com- and logistic regression, followed by a detour to discuss
prises 70000 handwritten digits, each of which comes in how we can combine multiple statistical techniques to
a square image, divided into a 28 × 28 pixel grid. The improve supervised learning, introducing bagging, boost-
first two datasets were chosen to reflect the various sub- ing, random forests, and XG Boost. These ideas, though
disciplines of physics (high-energy experiment, condensed fairly technical, lie at the root of many of the advances
matter) where we foresee techniques from ML becom- in ML over the last decade. The review continues with
ing an increasingly important tool for research. The a thorough discussion of supervised deep learning and
6
neural networks, as well as convolutional nets. We then on the training set is called the in-sample error Ein =
turn our focus to unsupervised learning. We start with C(ytrain , f (Xtrain ; θ)) and the value of the cost func-
data visualization and dimensionality reduction before tion on the test set is called the out-of-sample error
proceeding to a detailed treatment of clustering. Our Eout = C(ytest , f (Xtest ; θ)).
discussion of clustering naturally leads to an examina- One of the most important observations we can make
tion of variational methods and their close relationship is that the out-of-sample error is almost always greater
with mean-field theory. The review continues with a than the in-sample error, i.e. Eout ≥ Ein . We explore
discussion of deep unsupervised learning, focusing on this point further in Sec. VI and its accompanying note-
energy-based models, such as Restricted Boltzmann Ma- book. Splitting the data into mutually exclusive train-
chines (RBMs) and Deep Boltzmann Machines (DBMs). ing and test sets provides an unbiased estimate for the
Then we discuss two new and extremely popular model- predictive performance of the model – this is known as
ing frameworks for unsupervised learning, generative ad- cross-validation in the ML and statistics literature. In
versarial networks (GANs) and variational autoencoders many applications of classical statistics, we start with a
(VAEs). We conclude the review with an outlook and mathematical model that we assume to be true (e.g., we
discussion of promising research directions at the inter- may assume that Hooke’s law is true if we are observing
section physics and ML. a mass-spring system) and our goal is to estimate the
value of some unknown model parameters (e.g., we do
not know the value of the spring stiffness). Problems in
II. WHY IS MACHINE LEARNING DIFFICULT? ML, by contrast, typically involve inference about com-
plex systems where we do not know the exact form of the
A. Setting up a problem in ML and data science mathematical model that describes the system. There-
fore, it is not uncommon for ML researchers to have mul-
Many problems in ML and data science starts with tiple candidate models that need to be compared. This
the same ingredients. The first ingredient is the dataset comparison is usually done using Eout ; the model that
D = (X, y) where X is a matrix of independent variables minimizes this out-of-sample error is chosen as the best
and y is a vector of dependent variables. The second is model (i.e. model selection). Note that once we select
the model f (x; θ), which is a function f : x → y of the the best model on the basis of its performance on Eout ,
parameters θ. That is, f is a function used to predict an the real-world performance of the winning model should
output from a vector of input variables. The final ingre- be expected to be slightly worse because the test data
dient is the cost function C(y, f (X; θ)) that allows us to was now used in the fitting procedure.
judge how well the model performs on the observations y.
The model is fit by finding the value of θ that minimizes
the cost function. For example, one commonly used cost B. Polynomial Regression
function is the squared error. Minimizing the squared er-
ror cost function is known as the method of least squares, In the previous section, we mentioned that multiple
and is typically appropriate for experiments with Gaus- candidate models are typically compared using the out-
sian measurement errors. of-sample error Eout . It may be at first surprising that
ML researchers and data scientists follow a standard the model that has the lowest out-of-sample error Eout
recipe to obtain models that are useful for prediction usually does not have the lowest in-sample error Ein .
problems. We will see why this is necessary in the fol- Therefore, if our goal is to obtain a model that is use-
lowing sections, but it is useful to present the recipe up ful for prediction we may not want to choose the model
front to provide context. The first step in the analysis that provides the best explanation for the current obser-
is to randomly divide the dataset D into two mutually vations. At first glance, the observation that the model
exclusive groups Dtrain and Dtest called the training and providing the best explanation for the current dataset
test sets. The fact that this must be the first step should probably will not provide the best explanation for future
be heavily emphasized – performing some analysis (such datasets is very counter-intuitive.
as using the data to select important variables) before Moreover, the discrepancy between Ein and Eout be-
partitioning the data is a common pitfall that can lead to comes more and more important, as the complexity of our
incorrect conclusions. Typically, the majority of the data data, and the models we use to make predictions, grows.
are partitioned into the training set (e.g., 90%) with the As the number of parameters in the model increases,
remainder going into the test set. The model is fit by min- we are forced to work in high-dimensional spaces. The
imizing the cost function using only the data in the train- “curse of dimensionality” ensures that many phenomena
ing set θ̂ = arg minθ {C(ytrain , f (Xtrain ; θ))}. Finally, that are absent or rare in low-dimensional spaces become
the performance of the model is evaluated by computing generic. For example, the nature of distance changes in
the cost function using the test set C(ytest , f (Xtest ; θ̂)). high dimensions, as evidenced in the derivation of the
The value of the cost function for the best fit model Maxwell distribution in statistical physics where the fact
7
y
Training 1.0
−2 Linear
Poly 3 0.5
−4 Poly 10
0.0
0.0 0.2 0.4 0.6 0.8 1.0 0.00 0.25 0.50 0.75 1.00 1.25
x x
4 Test
60 linear
2 3rd order
40 10th order
0
y
Training
−2 Linear 20
Poly 3
−4 Poly 10
0
0.0 0.2 0.4 0.6 0.8 1.0 0.00 0.25 0.50 0.75 1.00 1.25
x x
FIG. 1 Fitting versus predicting for noiseless data. Ntrain = 10 points in the range x ∈ [0, 1] were generated from a
linear model (top) or tenth-order polynomial (bottom). This data was fit using three model classes: linear models (red), all
polynomials of order 3 (yellow), all polynomials of order 10 (green) and used to make prediction on Ntest = 20 new data points
with xtest ∈ [0, 1.2] (shown on right). Notice that in the absence of noise (σ = 0), given enough data points that fitting and
predicting are identical.
that all the volume of a d-dimensional sphere of radius we have, the “noise” in the data generation process, and
r is contained in a small spherical shell around r is ex- our prior knowledge about the system. The goal is to
ploited. Almost all critical points of a function (i.e., the build intuition about why prediction is difficult in prepa-
points where all derivatives vanish) are saddles rather ration for introducing general strategies that overcome
than maxima or minima (an observation first made in these difficulties.
physics in the context of the p-spin spherical spin glass). Before reading the rest of the section, we strongly en-
For all these reasons, it turns out that for complicated courage the reader to read Notebook 1 and complete the
models studied in ML, predicting and fitting are very accompanying exercises.
different things (Bickel et al., 2006). Consider a probabilistic process that assigns a label yi
To develop some intuition about why we need to pay to an observation xi . The data are generated by drawing
close attention to out-of-sample performance, we will samples from the equation
consider a simple one-dimensional problem – polynomial yi = f (xi ) + ηi , (1)
regression. Our task is a simple one, fitting data with
polynomials of different order. We will explore how our where f (xi ) is some fixed (but possibly unknown) func-
ability to predict depends on the number of data points tion, and ηi is a Gaussian, uncorrelated noise variable,
8
y
Training
−2 Linear 0
Poly 3
−5
−4 Poly 10
−10
0.0 0.2 0.4 0.6 0.8 1.0 0.00 0.25 0.50 0.75 1.00 1.25
x x
Training
−2 Linear 0
Poly 3
−5
−4 Poly 10
−10
0.0 0.2 0.4 0.6 0.8 1.0 0.00 0.25 0.50 0.75 1.00 1.25
x x
FIG. 2 Fitting versus predicting for noisy data. Ntrain = 100 noisy data points (σ = 1) in the range x ∈ [0, 1] were
generated from a linear model (top) or tenth-order polynomial (bottom). This data was fit using three model classes: linear
models (red), all polynomials of order 3 (yellow), all polynomials of order 10 (green) and used to make prediction on Ntest = 20
new data points with xtest ∈ [0, 1.2](shown on right). Notice that even when the data was generated using a tenth order
polynomial, the linear and third order polynomials give better out-of-sample predictions, especially beyond the x range over
which the model was trained.
such that we will consider three different model classes: (i) all poly-
nomials of order 1 which we denote by f1 (x; θ1 ), (ii) all
hηi i = 0, polynomials up to order 3 which we denote by f3 (x; θ3 ),
hηi ηj i = δij σ 2 . and (iii) all polynomials of order 10, f10 (x; θ10 ). Notice
that these three model classes contain different number
We will refer to the f (xi ) as the function used to generate of parameters. Whereas f1 (x; θ1 ) has only two parame-
the data, and σ as the noise strength. The larger σ is the ters (the coefficients of the zeroth and first order terms
noisier the data; σ = 0 corresponds to the noiseless case. in the polynomial), f3 (x; θ3 ) and f10 (x; θ10 ) have four
To make predictions, we will consider a family of func- and eleven parameters, respectively. This reflects the
tions fα (x; θα ) that depend on some parameters θα . fact that these three models have different model com-
These functions represent the model class that we are us- plexities. If we think of each term in the polynomial as a
ing to model the data and make predictions. Note that “feature” in our model, then increasing the order of the
we choose the model class without knowing the function polynomial we fit increases the number of features. Using
f (x). The fα (x; θα ) encode the features we choose to a more complex model class may give us better predic-
represent the data. In the case of polynomial regression
9
tive power, but only if we have a large enough sample noise encodes real information. This problem is called
size to accurately learn the model parameters associated “overfitting” and leads to a steep drop-off in predictive
with these extra features from the training dataset. performance.
To learn the parameters θα , we will train our models We can guard against overfitting in two ways: we can
on a training dataset and then test the effectiveness of use less expressive models with fewer parameters, or we
the model on a different dataset, the test dataset. Since can collect more data so that the likelihood that the noise
we are interested only in gaining intuition, we will simply appears patterned decreases. Indeed, when we increase
plot the fitted polynomials and compare the predictions the size of the training data set by two orders of mag-
of our fits for the test data with the true values. As we nitude to Ntrain = 104 (see Figure 3) the tenth order
will see below, the models that give the best fit to existing polynomial clearly gives both the best fits and the most
data do not necessarily make the best predictions even predictive power over the entire training range x ∈ [0, 1],
for a simple task like polynomial regression. and even slightly beyond to approximately x ≈ 1.05.
To illustrate these ideas, we encourage the reader to This is our first experience with what is known as the
experiment with the accompanying notebook to gener- bias-variance tradeoff, c.f. Sec. III.B. When the amount
ate data using a linear function f (x) = 2x and a tenth of training data is limited as it is when Ntrain = 100,
order polynomial f (x) = 2x − 10x5 + 15x10 and ask one can often get better predictive performance by using
how the size of the training dataset Ntrain and the noise a less expressive model (e.g., a lower order polynomial)
strength σ affect the ability to make predictions. Obvi- rather than the more complex model (e.g., the tenth-
ously, more data and less noise leads to better predic- order polynomial). The simpler model has more “bias”
tions. To train the models (linear, third-order, tenth- but is less dependent on the particular realization of the
order), we uniformly sampled the interval x ∈ [0, 1] and training dataset, i.e. less “variance”. Finally we note that
constructed Ntrain training examples using (1). We then even with ten thousand data points, the model’s perfor-
fit the models on these training samples using standard mance quickly degrades beyond the original training data
least-squares regression. To visualize the performance of range. This demonstrates the difficulty of predicting be-
the three models, we plot the predictions using the best yond the training data we mentioned earlier.
fit parameters for a test set where x are drawn uniformly This simple example highlights why ML is so difficult
from the interval x ∈ [0, 1.2]. Notice that the test interval and holds some universal lessons that we will encounter
is slightly larger than the training interval. repeatedly in this review:
Figure 1 shows the results of this procedure for the
noiseless case, σ = 0. Even using a small training set • Fitting is not predicting. Fitting existing data well
with Ntrain = 10 examples, we find that the model class is fundamentally different from making predictions
that generated the data also provides the best fit and the about new data.
most accurate out-of-sample predictions. That is, the
linear model performs the best for data generated from a
• Using a complex model can result in overfitting. In-
linear polynomial (the third and tenth order polynomials
creasing a model’s complexity (i.e number of fitting
perform similarly), and the tenth order model performs
parameters) will usually yield better results on the
the best for data generated from a tenth order polyno-
training data. However when the training data size
mial. While this may be expected, the results are quite
is small and the data are noisy, this results in over-
different for larger noise strengths.
fitting and can substantially degrade the predictive
Figure 2 shows the results of the same procedure for
performance of the model.
noisy data, σ = 1, and a larger training set, Ntrain = 100.
As in the noiseless case, the tenth order model provides
the best fit to the data (i.e., the lowest Ein ). In contrast, • For complex datasets and small training sets, sim-
the tenth order model now makes the worst out-of-sample ple models can be better at prediction than com-
predictions (i.e., the highest Eout ). Remarkably, this is plex models due to the bias-variance tradeoff. It
true even if the data were generated using a tenth order takes less data to train a simple model than a com-
polynomial. plex one. Therefore, even though the correct model
At small sample sizes, noise can create fluctuations in is guaranteed to have better predictive performance
the data that look like genuine patterns. Simple mod- for an infinite amount of training data (less bias),
els (like a linear function) cannot represent complicated the training errors stemming from finite-size sam-
patterns in the data, so they are forced to ignore the pling (variance) can cause simpler models to out-
fluctuations and to focus on the larger trends. Complex perform the more complex model when sampling is
models with many parameters, such as the tenth order limited.
polynomial in our example, can capture both the global
trends and noise-generated patterns at the same time. In • It is difficult to generalize beyond the situations
this case, the model can be tricked into thinking that the encountered in the training data set.
10
y
Training
−2 Linear 0
Poly 3
−5
−4 Poly 10
−10
0.0 0.2 0.4 0.6 0.8 1.0 0.00 0.25 0.50 0.75 1.00 1.25
x x
FIG. 3 Fitting versus predicting for noisy data. Ntrain = 104 noisy data points (σ = 1) in the range x ∈ [0, 1] were
generated from a tenth-order polynomial. This data was fit using three model classes: linear models (red), all polynomials
of order 3 (yellow), all polynomials of order 10 (green) and used to make prediction on Ntest = 100 new data points with
xtest ∈ [0, 1.2](shown on right). The tenth order polynomial gives good predictions but the model’s predictive power quickly
degrades beyond the training data range.
III. BASICS OF STATISTICAL LEARNING THEORY general about the relationship between Ein and Eout ?
Surprisingly, the answer is ‘Yes’. We can in fact say
In this section, we briefly summarize and discuss the quite a bit. This is the domain of statistical learning
sense in which learning is possible, with a focus on su- theory, and we give a brief overview of the main results
pervised learning. We begin with an unknown function in this section. Our goal is to briefly introduce some of
y = f (x) and fix a hypothesis set H consisting of all func- the major ideas from statistical learning theory because
tions we are willing to consider, defined also on the do- of the important role they have played in shaping how we
main of f . This set may be uncountably infinite (e.g. if think about machine learning. However, this is a highly
there are real-valued parameters to fit). The choice of technical and theoretical field, so we will just skim over
which functions to include in H usually depends on our some introductory topics. A more thorough introduction
intuition about the problem of interest. The function to statistical learning theory can be found in the intro-
f (x) produces a set of pairs (xi , yi ), i = 1 . . . N , which ductory textbook by Abu Mostafa (Abu-Mostafa et al.,
serve as the observable data. Our goal is to select a func- 2012).
tion from the hypothesis set h ∈ H that approximates
f (x) as best as possible, namely, we would like to find
h ∈ H such that h ≈ f in some strict mathematical A. Three simple schematics that summarize the basic
sense which we specify below. If this is possible, we say intuitions from Statistical Learning Theory
that we learned f (x). But if the function f (x) can, in
principle, take any value on unobserved inputs, how is it The basic intuitions of statistical learning can be sum-
possible to learn in any meaningful sense? marized in three simple schematics. The first schematic,
The answer is that learning is possible in the restricted shown in Figure 4, shows the typical out-of-sample er-
sense that the fitted model will probably perform approx- ror, Eout , and in-sample error, Ein , as a function of the
imately as well on new data as it did on the training data. amount of training data. In making this graph, we have
Once an appropriate error function E is chosen for the assumed that the true data is drawn from a sufficiently
problem under consideration (e.g. sum of squared errors complicated distribution, so that we cannot exactly learn
in linear regression), we can define two distinct perfor- the function f (x). Hence, after a quick initial drop (not
mance measures of interest. The in-sample error, Ein , shown in figure), the in-sample error will increase with
and the out-of-sample or generalization error, Eout . Re- the number of data points, because our models are not
call from Sec II that both metrics are required due to the powerful enough to learn the true function we are seeking
distinction between fitting and predicting. to approximate. In contrast, the out-of-sample error will
This raises a natural question: Can we say something decrease with the number of data points. As the number
11
Optimum
E out
E out
Error
{
Variance
Variance
}
}
Error
Bias
E in
FIG. 5 Bias-Variance tradeoff and model complexity.
This schematic shows the typical out-of-sample error Eout as
function of the model complexity for a training dataset of fixed
Number of data points size. Notice how the bias always decreases with model com-
plexity, but the variance, i.e. fluctuation in performance due
FIG. 4 Schematic of typical in-sample and out-of- to finite size sampling effects, increases with model complex-
sample error as a function of training set size. The ity. Thus, optimal performance is achieved at intermediate
typical in-sample or training error, Ein , out-of-sample or gen- levels of model complexity.
eralization error, Eout , bias, variance, and difference of errors
as a function of the number of training data points. The
schematic assumes that the number of data points is large (in
fitting and predicting. Models with a large difference be-
particular, the schematic does not show the initial drop in
Ein for small amounts of data), and that our model cannot tween the in-sample and out-of-sample errors are said to
exactly fit the true function f (x). “overfit” the data. One of the lessons of statistical learn-
ing theory is that it is not enough to simply minimize
the training error, because the out-of-sample error can
of data points gets large, the sampling noise decreases still be large. As we will see in our discussion of regres-
and the training data set becomes more representative sion in Sec. VI, this insight naturally leads to the idea of
of the true distribution from which the data is drawn. “regularization”.
For this reason, in the infinite data limit, the in-sample The second schematic, shown in Figure 5, shows the
and out-of-sample errors must approach the same value, out-of-sample, or test, error Eout as a function of “model
which is called the “bias” of our model. complexity”. Model complexity is a very subtle idea
The bias represents the best our model could do if we and defining it precisely is one of the great achieve-
had an infinite amount of training data to beat down ments of statistical learning theory. In many cases, model
sampling noise. The bias is a property of the kind of complexity is related to the number of parameters we
functions, or model class, we are using to approximate are using to approximate the true function f (x)1 . In
f (x). In general, the more complex the model class we the example of polynomial regression discussed above,
use, the smaller the bias. However, we do not generally higher-order polynomials are more complex than the lin-
have an infinite amount of data. For this reason, to get ear model. If we consider a training dataset of a fixed
best predictive power it is better to minimize the out-of- size, Eout will be a non-monotonic function of the model
sample error, Eout , rather than the bias. As shown in complexity, and is generally minimized for models with
Figure 4, Eout can be naturally decomposed into a bias, intermediate complexity. The underlying reason for this
which measures how well we can hypothetically do in the is that, even though using a more complicated model
infinite data limit, and a variance, which measures the always reduces the bias, at some point the model be-
typical errors introduced in training our model due to comes too complex for the amount of training data and
sampling noise from having a finite training set. the generalization error becomes large due to high vari-
The final quantity shown in Figure 4 is the difference ance. Thus, to minimize Eout and maximize our predic-
between the generalization and training error. It mea- tive power, it may be more suitable to use a more bi-
sures how well our in-sample error reflects the out-of-
sample error, and measures how much worse we would
do on a new data set compared to our training data. For 1 There are, of course, exceptions. One neat example in the context
this reason, the difference between these errors is pre- of one-dimensional regression in given in (Friedman et al., 2001),
cisely the quantity that measures the difference between Figure 7.5.
12
" #
X
2
ED, [C(y, f (X; θ̂D ))] = ED, (yi − f (xi ; θ̂D ))
i
" #
X
= ED, (yi − f (xi ) + f (xi ) − f (xi ; θ̂D ))2
i
X
= E [(yi − f (xi ))2 ] + ED, [(f (xi ) − f (xi ; θ̂D ))2 ] + 2E [yi − f (xi )]ED [f (xi ) − f (xi ; θ̂D )]
i
X
= σ2 + ED [(f (xi ) − f (xi ; θ̂D ))2 ], (5)
i
where in the last line we used the fact that our noise has zero mean and variance σ2 and the sum over i applies to all
13
The first term is called the bias However, in practice gradient descent is full of surprises
X and a series of ingenious tricks have been developed by
Bias2 = (f (xi ) − ED [f (xi ; θ̂D )])2 (7) the optimization and machine learning communities to
i
improve the performance of these algorithms.
and measures the deviation of the expectation value of The underlying reason why training a machine learn-
our estimator (i.e. the asymptotic value of our estimator ing algorithm is difficult is that the cost functions we
in the infinite data limit) from the true value. The second wish to optimize are usually complicated, rugged, non-
term is called the variance convex functions in a high-dimensional space with many
X local minima. To make things even more difficult, we
V ar = ED [(f (xi ; θ̂D ) − ED [f (xi ; θ̂D )])2 ], (8) almost never have access to the true function we wish
i
to minimize: instead, we must estimate this function di-
and measures how much our estimator fluctuates due rectly from data. In modern applications, both the size
to finite-sample effects. Combining these expressions, of the dataset and the number of parameters we wish to
we see that the expected out-of-sample error, Eout := fit is often enormous (millions of parameters and exam-
ED, [C(y, f (X; θ̂D ))], can be decomposed as ples). The goal of this chapter is to explain how gradient
descent methods can be used to train machine learning
Eout = Bias2 + V ar + N oise, (9) algorithms even in these difficult settings.
with N oise = i σ .
P 2 This chapter seeks to both introduce commonly used
The bias-variance tradeoff summarizes the fundamen- methods and give intuition for why they work. We
tal tension in machine learning, particularly supervised also include some practical tips for improving the per-
learning, between the complexity of a model and the formance of stochastic gradient descent (Bottou, 2012;
amount of training data needed to train it. Since data LeCun et al., 1998b). To help the reader gain more in-
is often limited, in practice it is often useful to use a tuition about gradient descent and its variants, we have
less-complex model with higher bias – a model whose developed a Jupyter notebook that allows the reader to
asymptotic performance is worse than another model – visualize how these algorithms perform on two dimen-
because it is easier to train and less sensitive to sampling sional surfaces. The reader is encouraged to experi-
noise arising from having a finite-sized training dataset ment with the accompanying notebook whenever a new
(smaller variance). This is the basic intuition behind the method is introduced (especially to explore how changing
schematics in Figs. 4, 5, and 6. hyper-parameters can affect performance). The reader
may also wish to consult useful reviews that cover these
topics (Ruder, 2016) and this blog http://ruder.io/
IV. GRADIENT DESCENT AND ITS GENERALIZATIONS optimizing-gradient-descent/.
η =0.1
η =0.5 1
−2.5
η =1 E(θ + v) ≈ E(θ) + ∇θ E(θ)v + vT H(θ)v,
2
η =1.01
−5.0 where H(θ) is the Hessian matrix of second derivatives.
−4 −2 0 2 4 Differentiating this equation respect to v and noting that
x for the optimal value vopt we expect ∇θ E(θ + vopt ) = 0,
yields the following equation
FIG. 7 Gradient descent exhibits three qualitatively
different regimes as a function of the learning rate. 0 = ∇θ E(θ) + H(θ)vopt . (12)
Result of gradient descent on surface z = x2 + y 2 − 1 for
learning rate of η = 0.1, 0.5, 1.01. Notice that the trajectory Rearranging this expression results in the desired update
converges to the global minima in multiple steps for small
rules for Newton’s method
learning rates (η = 0.1). Increasing the learning rate fur-
ther (η = 0.5) causes the trajectory to oscillate around the vt = H −1 (θt )∇θ E(θt ) (13)
global minima before converging. For even larger learning
rates (η = 1.01) the trajectory diverges from the minima. See θt+1 = θt − vt . (14)
corresponding notebook for details.
Since we have no guarantee that the Hessian is well con-
ditioned, in almost all applications of Netwon’s method,
data points, one replaces the inverse of the Hessian H −1 (θt ) by some
suitably regularized pseudo-inverse such as [H(θt )+I]−1
n
X with a small parameter (Battiti, 1992).
E(θ) = ei (xi , θ). (10) For the purposes of machine learning, Newton’s
i=1 method is not practical for two interrelated reasons.
For example, for linear regression ei is just the mean First, calculating a Hessian is an extremely expensive
square-error for data point i; for logistic regression, it is numerical computation. Second, even if we employ first-
the cross-entropy. To make analogy with physical sys- order approximation methods to approximate the Hes-
tems, we will often refer to this function as the “energy”. sian (commonly called quasi-Newton methods), we must
In the simplest gradient descent (GD) algorithm, we store and invert a matrix with n2 entries, where n is the
update the parameters as follows. Initialize the parame- number of parameters. For models with millions of pa-
ters to some value θ0 and iteratively update the param- rameters such as those commonly employed in the neu-
eters according to the equation ral network literature, this is close to impossible with
present-day computational power. Despite these practi-
vt = ηt ∇θ E(θt ), cal shortcomings, Newton’s method gives many impor-
θt+1 = θt − vt (11) tant intuitions about how to modify GD algorithms to
improve their performance. Notice that, unlike in GD
where ∇θ E(θ) is the gradient of E(θ) w.r.t. θ and we where the learning rate is the same for all parameters,
have introduced a learning rate, ηt , that controls how big Newton’s method automatically “adapts” the learning
a step we should take in the direction of the gradient at rate of different parameters depending on the Hessian
time step t. It is clear that for sufficiently small choice of matrix. Since the Hessian encodes the curvature of the
the learning rate ηt this methods will converge to a local surface we are trying to find the minimum of – more
minimum (in all directions) of the cost function. How- specifically, the singular values of the Hessian are in-
ever, choosing a small ηt comes at a huge computational versely proportional to the squares of the local curvatures
cost. The smaller ηt , the more steps we have to take to of the surface – Newton’s method automatically adjusts
reach the local minimum. In contrast, if ηt is too large, the step size so that one takes larger steps in flat di-
we can overshoot the minimum and the algorithm be- rections with small curvature and smaller steps in steep
comes unstable (it either oscillates or even moves away directions with large curvature.
from the minimum). This is shown in Figure 7. In prac- Our derivation of Newton’s method also allows us to
tice, one usually specifies a “schedule” that decreases ηt develop intuition about the role of the learning rate in
at long times. Common schedules include power law and GD. Let us first consider the special case of using GD
exponential decay in time. to find the minimum of a quadratic energy function of
To better understand this behavior and highlight some a single parameter θ (LeCun et al., 1998b). Given the
of the shortcomings of GD, it is useful to contrast GD current value of our parameter θ, we can ask what is
15
• GD is very sensitive to choices of the learning rates. really experiment with different methods in landscapes
As discussed above, GD is extremely sensitive to of varying complexity using the accompanying notebook.
the choice of learning rates. If the learning rate is
very small, the training process takes an extremely
long time. For larger learning rates, GD can di- C. Stochastic Gradient Descent (SGD) with mini-batches
verge and give poor results. Furthermore, depend-
ing on what the local landscape looks like, we have One of the most widely-applied variants of the gra-
to modify the learning rates to ensure convergence. dient descent algorithm is stochastic gradient descent
Ideally, we would “adaptively” choose the learning (SGD)(Bottou, 2012; Williams and Hinton, 1986). As
rates to match the landscape. the name suggests, unlike ordinary GD, the algorithm
is stochastic. Stochasticity is incorporated by approx-
• GD treats all directions in parameter space uni- imating the gradient on a subset of the data called a
formly. Another major drawback of GD is that minibatch 2 . The size of the minibatches is almost al-
unlike Newton’s method, the learning rate for GD ways much smaller than the total number of data points
is the same in all directions in parameter space. For n, with typical minibatch sizes ranging from ten to a
this reason, the maximum learning rate is set by the few hundred data points. If there are n points in total,
behavior of the steepest direction and this can sig- and the mini-batch size is M , there will be n/M mini-
nificantly slow down training. Ideally, we would like batches. Let us denote these minibatches by Bk where
to take large steps in flat directions and small steps k = 1, . . . , n/M . Thus, in SGD, at each gradient descent
in steep directions. Since we are exploring rugged step we approximate the gradient using a single mini-
landscapes where curvatures change, this requires batch Bk ,
us to keep track of not only the gradient but second n
X X
derivatives of the energy function (note as discussed ∇θ E(θ) = ∇θ ei (xi , θ) −→ ∇θ ei (xi , θ). (19)
above, the ideal scenario would be to calculate the i=1 i∈Bk
Hessian but this proves to be too computationally We then cycle over all k = 1, . . . , n/M minibatches one
expensive). at a time, and use the mini-batch approximation to the
gradient to update the parameters θ at every step k. A
• GD is sensitive to initial conditions. One conse- full iteration over all n data points – in other words using
quence of the local nature of GD is that initial con- all n/M minibatches – is called an epoch. For notational
ditions matter. Depending on where one starts, one convenience, we will denote the mini-batch approxima-
will end up at a different local minimum. There- tion to the gradient by
fore, it is very important to think about how one X
initializes the training process. This is true for GD ∇θ E M B (θ) = ∇θ ei (xi , θ). (20)
as well as more complicated variants of GD intro- i∈Bk
duced below. With this notation, we can rewrite the SGD algorithm as
• GD can take exponential time to escape saddle vt = ηt ∇θ E M B (θ),
points, even with random initialization. As we men- θt+1 = θt − vt . (21)
tioned, GD is extremely sensitive to the initial con- Thus, in SGD, we replace the actual gradient over the
dition since it determines the particular local min- full data at each gradient descent step by an approxima-
imum GD would eventually reach. However, even tion to the gradient computed using a minibatch. This
with a good initialization scheme, through random- has two important benefits. First, it introduces stochas-
ness (to be introduced later), GD can still take ex- ticity and decreases the chance that our fitting algorithm
ponential time to escape saddle points, which are gets stuck in isolated local minima. Second, it signifi-
prevalent in high-dimensional spaces, even for non- cantly speeds up the calculation as one does not have
pathological objective functions (Du et al., 2017). to use all n data points to approximate the gradient.
Indeed, there are modified GD methods developed Empirical and theoretical work suggests that SGD has
recently to accelerate the escape. The details of additional benefits. Chief among these is that introduc-
these boosted method are beyond the scope of this ing stochasticity is thought to act as a natural regular-
review, and we refer avid readers to (Jin et al., izer that prevents overfitting in deep, isolated minima
2017) for details. (Bishop, 1995a; Keskar et al., 2016).
In the next few subsections, we will introduce variants
of GD that address many of these shortcomings. These 2 Traditionally, SGD was reserved for the case where you train on
generalized gradient descent methods form the backbone a single example – in other words minibatches of size 1. However,
of much of modern deep learning and neural networks, we will use SGD to mean any approximation to the gradient on
see Sec IX. For this reason, the reader is encouraged to a subset of the data.
17
wt+∆t − 2wt + wt−∆t wt+∆t − wt E. Methods that use the second moment of the gradient
m +µ = −∇w E(w).
(∆t)2 ∆t
(25) In stochastic gradient descent, with and without mo-
Rearranging this equation, we can rewrite this as mentum, we still have to specify a “schedule” for tuning
the learning rate ηt as a function of time. As discussed in
(∆t)2 m the context of Newton’s method, this presents a number
∆wt+∆t = − ∇w E(w) + ∆wt . (26) of dilemmas. The learning rate is limited by the steepest
m + µ∆t m + µ∆t
direction which can change depending on the current po-
Notice that this equation is identical to Eq. (23) if we sition in the landscape. To circumvent this problem, ide-
identify the position of the particle, w, with the parame- ally our algorithm would keep track of curvature and take
ters θ. This allows us to identify the momentum param- large steps in shallow, flat directions and small steps in
eter and learning rate with the mass of the particle and steep, narrow directions. Second-order methods accom-
the viscous damping as: plish this by calculating or approximating the Hessian
and normalizing the learning rate by the curvature. How-
m (∆t)2 ever, this is very computationally expensive for models
γ= , η= . (27) with extremely large number of parameters. Ideally, we
m + µ∆t m + µ∆t
18
would like to be able to adaptively change the step size respectively, and (βj )t denotes βj to the power t. The
to match the landscape without paying the steep compu- parameters η and have the same role as in RMSprop.
tational price of calculating or approximating Hessians. Like in RMSprop, the effective step size of a parameter
Recently, a number of methods have been introduced depends on the magnitude of its gradient squared. To
that accomplish this by tracking not only the gradient, understand this better, let us rewrite this expression in
but also the second moment of the gradient. These terms of the variance σt2 = ŝt − (m̂t )2 . Consider a single
methods include AdaGrad (Duchi et al., 2011), AdaDelta parameter θt . The update rule for this parameter is given
(Zeiler, 2012), RMSprop (Tieleman and Hinton, 2012), by
and ADAM (Kingma and Ba, 2014). Here, we discuss
the last two as representatives of this class of algorithms. m̂t
∆θt+1 = −ηt p . (32)
In RMSprop, in addition to keeping a running average σt2 + m̂2t +
of the first moment of the gradient, we also keep track of
the second moment denoted by st = E[gt2 ]. The update We now examine different limiting cases of this expres-
rule for RMSprop is given by sion. Assume that our gradient estimates are consistent
so that the variance is small. In this case our update
gt = ∇θ E(θ) (29) rule tends to ∆θt+1 → −ηt (here we have assumed that
st = βst−1 + (1 − β)gt2 m̂t ). This is equivalent to cutting off large persis-
gt tent gradients at 1 and limiting the maximum step size
θt+1 = θt − ηt √ ,
st + in steep directions. On the other hand, imagine that the
gradient is widely fluctuating between gradient descent
where β controls the averaging time of the second mo-
steps. In this case σ 2 m̂2t so that our update becomes
ment and is typically taken to be about β = 0.9, ηt is a
∆θt+1 → −ηt m̂t /σt . In other words, we adapt our learn-
learning rate typically chosen to be 10−3 , and ∼ 10−8
ing rate so that it is proportional to the signal-to-noise
is a small regularization constant to prevent divergences.
ratio (i.e. the mean in units of the standard deviation).
Multiplication and division by vectors is understood as
From a physics standpoint, this is extremely desirable:
an element-wise operation. It is clear from this formula
the standard deviation serves as a natural adaptive scale
that the learning rate is reduced in directions where the
for deciding whether a gradient is large or small. Thus,
gradient is consistently large. This greatly speeds up the
ADAM has the beneficial effects of (i) adapting our step
convergence by allowing us to use a larger learning rate
size so that we cut off large gradient directions (and hence
for flat directions.
prevent oscillations and divergences), and (ii) measuring
A related algorithm is the ADAM optimizer. In
gradients in terms of a natural length scale, the stan-
ADAM, we keep a running average of both the first and
dard deviation σt . The discussion above also explains
second moment of the gradient and use this information
empirical observations showing that the performance of
to adaptively change the learning rate for different pa-
both ADAM and RMSprop is drastically reduced if the
rameters. In addition to keeping a running average of the
square root is omitted in the update rule. It is also
first and second moments of the gradient (i.e. mt = E[gt ]
worth noting that recent studies have shown adaptive
and st = E[gt2 ], respectively), ADAM performs an addi-
methods like RMSProp, ADAM, and AdaGrad to gener-
tional bias correction to account for the fact that we are
alize worse than SGD in classification tasks, though they
estimating the first two moments of the gradient using a
achieve smaller training error. Such discussion is beyond
running average (denoted by the hats in the update rule
the scope of this review so we refer readers to (Wilson
below). The update rule for ADAM is given by (where
et al., 2017) for more details.
multiplication and division are once again understood to
be element-wise operations)
gt = ∇θ E(θ) (30) F. Comparison of various methods
mt = β1 mt−1 + (1 − β1 )gt
To better understand these methods, it is helpful to
st = β2 st−1 + (1 − β2 )gt2 visualize the performance of the five methods discussed
mt
m̂t = above – gradient descent (GD), gradient descent with
1 − (β1 )t momentum (GDM), NAG, ADAM, and RMSprop. To
st do so, we will use Beale’s function:
ŝt =
1 − (β2 )t
m̂t f (x, y) = (1.5 − x + xy)2 (33)
θt+1 = θt − ηt √ , 2 2 3 2
ŝt + +(2.25 − x + xy ) + (2.625 − x + xy ) .
(31)
This function has a global minimum at (x, y) = (3, 0.5)
where β1 and β2 set the memory lifetime of the first and and an interesting structure that can be seen in Fig. 9.
second moment and are typically taken to be 0.9 and 0.99 The figure shows the results of using all five methods
19
main idea of statistical mechanics in physics, where we look at the data then we would like to select an unin-
use probability to describe the behavior of large systems formative prior that reflects our ignorance, otherwise we
where we cannot know the positions and momenta of all should select an informative prior that accurately reflects
the particles even if the system itself is fully determinis- the knowledge we have about θ. This review will focus
tic (at least classically). In practice, Bayesian inference on informative priors that are commonly used for ML
provides a set of principles and procedures for learning applications. However, there is a large literature on un-
from data and for describing uncertainty. In this section, informative priors, including reparameterization invari-
we give a gentle introduction to Bayesian inference, with ant priors, that would be of interest to physicists and
special emphasis on its logic (i.e. Bayesian reasoning) and we refer the interested reader to (Berger and Bernardo,
provide a connection to ML discussed in Sec. II and III. 1992; Gelman et al., 2014; Jaynes, 1996; Jeffreys, 1946;
For a technical account of Bayesian inference in general, Mattingly et al., 2018).
we refer readers to (Barber, 2012; Gelman et al., 2014). Using an informative prior tends to decrease the vari-
ance of the posterior distribution while, potentially, in-
creasing its bias. This is beneficial if the decrease in
A. Bayes Rule variance is larger than the increase in bias. In high-
dimensional problems, it is reasonable to assume that
To solve a problem using Bayesian methods, we have many of the parameters will not be strongly relevant.
to specify two functions: the likelihood function p(X|θ), Therefore, many of the parameters of the model will
which describes the probability of observing a dataset be zero or close to zero. We can express this belief
X for a given value of the unknown parameters θ, and using two commonly used priors: the Gaussian prior
the prior distribution p(θ), which describes any knowl- Q q λ −λθ2
p(θ|λ) = j 2π e j is used to express the assump-
edge we have about the parameters before we collect the
tion that many of the parameters will be small, and the
data. Note that the likelihood should be considered as
Laplace prior p(θ|λ) = j λ2 e−λ|θj | is used to express the
Q
a function of the parameters θ with the data X held
assumption that many of the parameters will be zero.
fixed. The prior distribution and the likelihood function
We’ll come back to this point later in Sec. VI.F.
are used to compute the posterior distribution p(θ|X)
via Bayes’ rule:
B. Bayesian Decisions
p(X|θ)p(θ)
p(θ|X) = R . (34)
dθ 0 p(X|θ 0 )p(θ 0 ) The above section presents the tools for computing the
posterior distribution p(θ|X), which uses probability as
The posterior distribution describes our knowledge about
a framework for expressing our knowledge about the pa-
the unknown parameter θ after observing the data X.
rameters θ. In most cases, however, we need to summa-
In many cases, it will not be possible to analytically
rize our knowledge and pick a single “best” value for the
compute the normalizing constant in the R denominator of parameters. In principle, the specific value of the param-
the posterior distribution, i.e. p(X) = dθ p(X|θ)p(θ),
eters should be chosen to maximize a utility function.
and Markov Chain Monte Carlo (MCMC) methods are
In practice, however, we usually use one of two choices:
needed to draw random samples from p(θ|X).
the posterior mean hθi = dθ θp(θ|X), or the poste-
R
The likelihood function p(X|θ) is a common feature
rior mode θ̂MAP = arg maxθ p(θ|X). Often, hθi is called
of both classical statistics and Bayesian inference, and
is determined by the model and the measurement noise. the Bayes estimate and θ̂MAP is called the maximum-a-
Many common statistical procedures such as least-square posteriori or MAP estimate. While the Bayes estimate
fitting can be cast as Maximum Likelihood Estimation minimizes the mean-squared error, the MAP estimate is
(MLE). In MLE, one chooses the parameters θ̂ that max- often used instead because it is easier to compute.
imize the likelihood (or equivalently the log-likelihood
since log is a monotonic function) of the observed data:
C. Hyperparameters
θ̂ = arg max log p(X|θ). (35) The Gaussian and Laplace prior distributions, used to
θ
express the assumption that many of the model parame-
In other words, in MLE we choose the parameters that ters will be small or zero, both have an extra parameter
maximize the probability of seeing the observed data λ. This hyperparameter or nuisance variable has to be
given our generative model. MLE is an important con- chosen somehow. One standard Bayesian approach is to
cept in both frequentist and Bayesian statistics. define another prior distribution for λ – usually using an
The prior distribution, by contrast, is uniquely uninformative prior – and to average the posterior distri-
Bayesian. There are two general classes of priors: if we bution over all choices of λ. This is called a hierarchical
do not have any specialized knowledge about θ before we prior. Computing averages, however, often requires long
21
Markov Chain Monte Carlo simulations that are compu- the columns X:,j ∈ Rn , j = 1, · · · p being measured fea-
tationally intensive. Therefore, it is simpler if we can tures. Bear in mind that this function f is never known
find a good value of λ using an optimization procedure to us explicitly, though in practice we usually presume
instead. We will discuss how this is done in practice when its functional form. For example, in linear regression, we
discussing linear regression in Sec. VI. assume yi = f (x(i) ; wtrue ) + i = wtrue
T
x(i) + i for some
unknown but fixed wtrue ∈ R . p
in response to the applied electric current I. Normally In other words, we are looking to find the w which mini-
we would first make a bunch of measurements labeled mizes the L2 error. Geometrically speaking, the predictor
by i and plot them on a two-dimensional scatterplot, function g(x(i) ; w) = wT x(i) defines a hyperplane in Rp .
(Vi , Ii ). The next step is to assume, either from an oracle Minimizing the least squares error is therefore equivalent
or from theoretical reasoning, some models that might to minimizing the sum of all projections (i.e. residuals)
explain the measurements and measuring their perfor- for all points x(i) to this hyperplane (see Fig. 10). For-
mance. Mathematically, this amounts to finding some mally, we denote the solution to this problem as ŵLS :
function f such that Vi = f (Ii ; w), where w is some pa-
rameter (e.g. the electrical resistance R of the metal slab
in the case of Ohm’s law). We then try to minimize the ŵLS = arg min ||Xw − y||22 , (38)
errors made in explaining the given set of measurements w∈Rp
based on our model f by tuning the parameter w. To
which, after straightforward differentiation, leads to
do so, we need to first define the error function (formally
called the loss function) that characterizes the deviation ŵLS = (X T X)−1 X T y. (39)
of our prediction from the actual response.
Before formulating the problem, let us set up the no- Note that we have assumed that X T X is invertible,
tation. Suppose we are given a dataset with n sam- which is often the case when n p. Formally speak-
ples D = {(yi , x(i) )}ni=1 , where x(i) is the i-th obser- ing, if rank(X) = p, namely, the predictors X:,1 , . . . , X:,p
vation vector while yi is its corresponding (scalar) re- (i.e. columns of X) are linearly independent, then ŵLS is
sponse. We assume that every sample has p features, unique. In the case of rank(X) < p, which happens when
namely, x(i) ∈ Rp . Let f be the true function/model p > n, X T X is singular, implying there are infinitely
that generated these samples via yi = f (x(i) ; wtrue ) + i , many solutions to the least squares problem, Eq. (38).
where wtrue ∈ Rp is a parameter vector and i is some In this case, one can easily show that if w0 is a solution,
i.i.d. white noise with zero mean and finite variance. w0 +η is also a solution for any η which satisfies Xη = 0
Conventionally, we cast all samples into an n × p ma- (i.e. η ∈ null(X)). Having determined the least squares
trix, X ∈ Rn×p , called the design matrix, with the rows solution, we can calculate ŷ, the best fit of our data X,
Xi,: = x(i) ∈ Rp , , i = 1, · · · , n being observations and as ŷ = X ŵLS = PX y, where PX = X(X T X)−1 X T ,
22
c.f. Eq. (37). Geometrically, PX is the projection matrix regularization: the first one employs an L2 penalty and
which acts on y and projects it onto the column space is called Ridge regression, while the second uses an L1
of X, which is spanned by the predictors X:,1 , · · · , X:,p penalty and is called LASSO.
(see FIG. 11). Notice that we found the optimal solu-
tion ŵLS in one shot, without doing any sort of iterative
optimization like that discussed in Section IV. y
span( { X 1 , · · · , X p } )
y − ŷ
ŷ
tion of Ēin and Ēout in Section III, the average in-sample This problem is equivalent to the following constrained
and out-of-sample error can be shown to be optimization problem
p
Ēin = σ 2 1 − (40) ŵRidge (t) = arg min ||Xw − y||22 . (44)
n
p w∈Rp : ||w||22 ≤t
Ēout = σ 2 1 + , (41)
n This means that for any t ≥ 0 and solution ŵRidge in
provided we obtain the least squares solution ŵLS from Eq. (44), there exists a value λ ≥ 0 such that ŵRidge
i.i.d. samples X and y generated through y = Xwtrue + solves Eq. (43), and vice versa4 . With this equivalence, it
3 . Therefore, we can calculate the average generaliza- is obvious that by adding a regularization term, λ||w||22 ,
tion error explicitly: to our least squares loss function, we are effectively con-
p straining the magnitude of the parameter vector learned
|Ēin − Ēout | = 2σ 2 . (42) from the data.
n
To see this, let us solve Eq. (43) explicitly. Differenti-
This imparts an important message: if we have p n ating w.r.t. w, we obtain,
(i.e. high-dimensional data), the generalization error is
extremely large, meaning the model is not learning. Even ŵRidge (λ) = (X T X + λIp×p )−1 X T y. (45)
when we have p ≈ n, we might still not learn well due
to the intrinsic noise σ 2 . One way to ameliorate this
is, as we shall see in the following few sections, to use
4
regularization. We will mainly focus on two forms of Note that the equivalence between the penalized and the con-
strained (regularized) form of least square optimization does not
always hold. It holds for Ridge and LASSO (introduced later),
but not for best subset selection which is defined by choosing a
L0 norm: λ||w||0 . In this case, for every λ > 0 and any ŵBS
3 This requires that is a noise vector whose elements are i.i.d. of that solves the penalized form of best subset selection, there is a
zero mean and variance σ 2 , and is independent of the samples value t ≥ 0 such that ŵBS also solves that constrained form of
X. best subset selection, but the converse is not true.
23
In fact, when X is orthogonal, one can simplify this ex- As in Ridge regression, there is another formulation for
pression further: LASSO based on constrained optimization, namely,
ŵLS ŵLASSO (t) = arg min ||Xw − y||22 . (53)
ŵRidge (λ) = , for orthogonal X, (46)
1+λ w∈Rp : ||w||1 ≤t
where ŵLS is the least squares solution given by Eq. (39). The equivalence interpretation is the same as in Ridge
This implies that the ridge estimate is merely the least regression, namely, for any t ≥ 0 and solution ŵLASSO in
squares estimate scaled by a factor (1 + λ)−1 . Eq. (53), there is a value λ ≥ 0 such that ŵLASSO solves
Can we derive a similar relation between the fitted Eq. (52), and vice versa. However, to get the analytic
vector ŷ = X ŵRidge and the prediction made by least solution of LASSO, we cannot simply take the gradient
squares linear regression? To answer this, let us do a sin- of Eq. (52) with respect to w, since the L1 -regularizer is
gular value decomposition (SVD) on X. Recall that the not everywhere differentiable, in particular at any point
SVD of an n × p matrix X has the form where wj = 0 (see Fig. 13). Nonetheless, LASSO is a
convex problem. Therefore, we can invoke the so-called
X = U DV T , (47)
“subgradient optimality condition" (Boyd and Vanden-
where U ∈ Rn×p and V ∈ Rp×p are orthogonal matrices berghe, 2004; Rockafellar, 2015) in optimization theory
such that the columns of U span the column space of to obtain the solution. To keep the notation simple, we
X while the columns of V span the row space of X. only show the solution assuming X is orthogonal:
D ∈ Rp×p =diag(d1 , d2 , · · · , dp ) is a diagonal matrix with
ŵjLASSO (λ) = sign(ŵjLS )(|ŵjLS | − λ)+ , for orthogonal X,
entries d1 ≥ d2 ≥ · · · dp ≥ 0 called the singular values of
(54)
X. Note that X is singular if there is at least one dj = 0.
where (x)+ denotes the positive part of x and ŵjLS is
By writing X in terms of its SVD, one can recast the
the j-th component of least squares solution. In Fig. 12,
Ridge estimator Eq. (45) as
we compare the Ridge solution Eq. (46) with LASSO
ŵRidge = V (D 2 + λI)−1 DU T y, (48) solution Eq. (54). As we mentioned above, the Ridge
solution is the least squares solution scaled by a factor
which implies that the Ridge predictor satisfies of (1 + λ). Here LASSO does something conventionally
ŷRidge = X ŵRidge called “soft-thresholding" (see Fig. 12). We encourage
interested readers to work out the exercises in Notebook
= U D(D 2 + λI)−1 DU T y
p
3 to explore what this function does.
X d2j
= U:,j 2 U:jT y (49) LASSO Ridge
j=1
dj + λ
≤ U U Ty (50)
scaled by
= X ŷ ≡ ŷLS , (51) λ
λ 1+ λ
where U:,j are the columns of U . Note that in the in-
λ
equality step we assumed λ ≥ 0 and used SVD to sim-
plify Eq. (39). By comparing Eq. (49) with Eq. (51), it is
clear that in order to compute the fitted vector ŷ, both
Ridge and least squares linear regression have to project FIG. 12 [Adapted from (Friedman et al., 2001)] Comparing
y to the column space of X. The only difference is that LASSO and Ridge regression. The black 45 degree line is
Ridge regression further shrinks each basis component j the unconstrained estimate for reference. The estimators are
by a factor d2j /(d2j + λ). We encourage the reader to do shown by red dashed lines. For LASSO, this corresponds to
the exercises in Notebook 3 to develop further intuition the soft-thresholding function Eq. (54) while for Ridge regres-
about how Ridge regression works. sion the solution is given by Eq. (46)
Performance
0.6
cause the regressor contours are in the shape of ovals (it
is quadratic in w), their intersection tends to occur at 0.4
the vertex of the feasibility region, implying the solution
vector will be sparse. 0.2
0.0
2 1 0 1 2
ŵ 10 10 10 10 10
ŵ
w2 w2
FIG. 14 Performance of LASSO and ridge regression on the
t
diabetes dataset measured by the R2 coefficient of determina-
t tion. The best possible performance is R2 = 1. See Notebook
w1 w1 3.
D. Using Linear Regression to Learn the Ising Hamiltonian numbers Ej mean, and the configuration {Sj }L j=1 can be
interpreted in many ways: the outcome of coin tosses,
To gain deeper intuition about what kind of physics black-and-white pixels of an image, the binary represen-
problems linear regression allows us to tackle, consider tation of integers, etc. Your goal is to learn a model that
the following problem of learning the Hamiltonian for predicts Ej from the spin configurations.
the Ising model. Imagine you are given an ensemble of Without any prior knowledge about the origin of the
random spin configurations, and assigned to each state data set, physics intuition may suggest to look for a spin
its energy, generated from the 1D Ising model: model with pairwise interactions between every pair of
L
X variables. That is, we choose the following model class:
H = −J Sj Sj+1 (55)
L X
L
j=1 X
Hmodel [S i ] = − Jj,k Sji Ski , (56)
where J is the nearest-neighbor spin interaction, and j=1 k=1
Sj ∈ {±1} is a spin variable. Let’s assume the data
was generated with J = 1. You are handed the data The goal is to determine the interaction matrix Jj,k by
set D = ({Sj }L
j=1 , Ej ) without knowledge of what the applying linear regression on the data set D. This is a
25
well-defined problem, since the unknown Jj,k enters lin- data, was set to unity, J = 1. Moreover, Jj,k was NOT
early into the definition of the Hamiltonian. To this end, defined to be symmetric (we only used the Jj,j+1 but
we cast the above ansatz into the more familiar linear- never the Jj,j−1 elements). Figure. 17 shows the matrix
regression form: representation of the learned weights Jj,k . Interestingly,
OLS and Ridge regression learn nearly symmetric weights
Hmodel [S i ] = Xi · J. (57) J ≈ −0.5. This is not surprising, since it amounts to tak-
ing into account both the Jj,j+1 and the Jj,j−1 terms, and
The vectors Xi represent all two-body interactions
the weights are distributed symmetrically between them.
j,k=1 , and the index i runs over the samples in
{Sji Ski }L
LASSO, on the other hand, tends to break this symme-
the dataset. To make the analogy complete, we can also
try (see matrix elements plots for λ = 0.01) 5 . Thus,
represent the dot product by a single index p = {j, k},
we see how different regularization schemes can lead to
i.e. Xi · J = Xpi Jp . Note that the regression model does
learning equivalent models but in different ‘gauges’. Any
not include the minus sign. In the following, we apply
information we have about the symmetry of the unknown
ordinary least squares, Ridge, and LASSO regression to
model that generated the data should be reflected in the
the problem, and compare their performance.
definition of the model and the choice of regularization.
In addition to the diabetes dataset in Notebook 3, we
1.0
encourage the reader to work out Notebook 4 in which
linear regression is applied to the one-dimensional Ising
0.8
Train (OLS) model.
0.6 Test (OLS)
R2
FIG. 17 Learned interaction matrix Jij for the Ising model ansatz in Eq. (56) for ordinary least squares (OLS) regression
(left), Ridge regression (middle) and LASSO (right) at different regularization strengths λ. OLS is λ-independent but is shown
for comparison throughout.See Notebook 4.
27
readers to (Boyd and Vandenberghe, 2004; Rockafellar, Using the assumption that samples are i.i.d., we can write
2015). the log-likelihood as
Now let us examine the two regularizers we introduced n
earlier. A close inspection reveals that LASSO and Ridge l(θ) ≡ log p(D|θ) =
X
log p(yi |x(i) , θ). (63)
regressions are both convex problems but only Ridge re- i=1
gression is a strictly convex problem (assuming λ > 0).
From convexity theory, this means that we always have a Note that the conditional dependence of the response
unique solution for Ridge but not necessary for LASSO. variable yi on the independent variable x(i) in the likeli-
In fact, it was recently shown that under mild conditions, hood function is made explicit since in regression the ob-
such as demanding general position for columns of X, served value of data, yi , is predicted based on x(i) using
the LASSO solution is indeed unique (Tibshirani et al., a model that is assumed to be a probability distribution
2013). Apart from this theoretical characterization, (Zou that depends on unknown parameter θ. This distribu-
and Hastie, 2005) introduced the notion of Elastic Net to tion, when endowed with θ, can, as we hope, potentially
retain the desirable properties of both LASSO and Ridge explain our prediction on yi . By definition, such distri-
regression, which is now one of the standard tools for bution is the likelihood function we discussed in Sec. V.
regression analysis and machine learning. We refer to Note that this is consistent with the formal statistical
reader to explore this in Notebook 2. treatment of regression where the goal is to estimate the
conditional expectation of the dependent variable given
the value of the independent variable (sometimes called
F. Bayesian formulation of linear regression the covariate) (Wasserman, 2013). We stress that this
notation does not imply x(i) is unknown– it is still part
In Section V, we gave an overview of Bayesian inference of the observed data!
and phrased it in the context of learning and uncertainty Using Eq. (61), we get
quantification. In this section we formulate least squares n 2 n
regression from a Bayesian point of view. We shall see 1 X
yi − wT x(i) − log 2πσ 2
l(θ) = − 2
that regularization in learning will emerge naturally as 2σ i=1 2
part of the Bayesian inference procedure. 1
From the setup of linear regression, the data D used to =− ||Xw − y||22 + const. (64)
2σ 2
fit the regression model is generated through y = xT w +
. We often assume that is a Gaussian noise with mean By comparing Eq. (38) and Eq. (64), it is clear that per-
zero and variance σ 2 . To connect linear regression to the forming least squares is the same as maximizing the log-
Bayesian framework, we often write the model as likelihood of this model.
What about adding regularization? In Section V, we
p(y|x, θ) = N (y|µ(x), σ 2 (x)). (61) introduced the maximum a posteriori probability (MAP)
estimate. Here we show that it actually corresponds to
In other words, our regression model is defined by a con- regularized linear regression, where the choice of prior
ditional probability that depends not only on data x but determines the type of regularization. Recall Bayes’ rule
on some model parameters θ. For example, if the mean
is a linear function of x given by µ = xT w, and the p(θ|D) ∝ p(D|θ)p(θ). (65)
variance is fixed σ 2 (x) = σ 2 , then θ = (w, σ 2 ). Now instead of maximizing the log-likelihood, l(θ) =
In statistics, many problems rely on estimation of some log p(D|θ), let us maximize the log posterior, log p(θ|D).
parameters of interest. For example, suppose we are Invoking Eq. (65), the MAP estimator becomes
given the height data of 20 junior students from a regional
high school, but what we are interested in is the average θ̂MAP ≡ arg max log p(D|θ) + log p(θ). (66)
height of all high school juniors in the whole county. It θ
is conceivable that the data we are given are not rep- In Sec. V.C, we discussed that a common choice for the
resentative of the student population as a whole. It is prior is a Gaussian distribution. Consider the Gaussian
therefore necessary to devise a systematic way to pre- prior6 with zero mean and variance τ 2 , namely, p(w) =
form reliable estimation. Here we present the maximum
likelihood estimation (MLE), and show that MLE for θ
is the one that minimizes the mean squared error (MSE)
used in OLS, see Sec.VI.A. 6 Indeed, a Gaussian prior is the conjugate prior that gives a Gaus-
MLE is defined by maximizing the log-likelihood sian posterior. For a given likelihood, conjugacy guarantees the
preservation of prior distribution at the posterior level. For ex-
w.r.t. the parameters θ: ample, for a Gaussian (Geometric) likelihood with a Gaussian
(Beta) prior, the posterior distribution is still Gaussian (Beta)
θ̂ ≡ arg max log p(D|θ). (62) distribution.
θ
28
N (wj |0, τ 2 ). Then, we can recast the MAP estimator probably aware of the time of day, that it is a Wednes-
Q
j
into day, your friend Alice being in attendance, your friend
Bob being absent with a cold, the country in which you
n n
1 X 1 X are doing the experiment, and the planet you are on, but
θ̂MAP ≡ arg max − 2 (yi − wT x(i) )2 − 2 w2
θ 2σ i=1 2τ j=1 j you almost assuredly haven’t written these down in your
notebook. Why not? The reason is because you entered
1 1 the classroom with strongly held prior beliefs that none of
= arg max − 2 ||Xw − y||2 − 2 ||w||2 . (67)
2 2
θ 2σ 2τ those things affect the physics which takes place in that
room. Even of the things you did write down in an effort
Note that we dropped constant terms that do not de-
to be a careful scientist you probably hold some doubt
pend on the maximization parameters θ. The equiva-
as to their importance to your result and what is serving
lence between MAP estimation with a Gaussian prior
you here is the intuition that probably only a few things
and Ridge regression is established by comparing Eq. (67)
matter in the physics of pendula. Hence again you are
and Eq. (44) with λ ≡ σ 2 /τ 2 . We relegate the analogous
approaching the experiment with prior beliefs about how
derivation for LASSO to an exercise in Notebook 3.
many features you will need to pay attention to in order
to predict what will happen when you swing an unknown
G. Recap and a general perspective on regularizers pendulum. This example might seem a bit contrived, but
the point is that we live in a high-dimensional world of
In this section, we explored least squares linear regres- information and while we have good intuition about what
sion with and without regularization. We motivated the to write down in our notebook for well-known problems,
need for regularization due to poor generalization, in par- often in the field of ML we cannot say with any confi-
ticular in the “high-dimensional limit" (p n). Instead dence a priori what the small list of things to write down
of showing the average in-sample and out-of-sample er- will be, but we can at least use regularization to help us
rors for the regularized problem explicitly, we conducted enforce that the list not be too long so that we don’t end
numerical experiments in Notebook 3 on the diabetes up predicting that the period of a pendulum depends on
dataset and showed that regularization typically leads Bob having a cold on Wednesdays.
to better generalization. Due to the equivalence between Of course, in both LASSO and Ridge regression there
the constrained and penalized form of regularized regres- is a parameter λ involved. In principle, this hyper-
sion (in LASSO and Ridge, but not generally true in cases parameter is usually predetermined, which means that
such as L0 penalization), we can regard the regularized it is not part of the regression process. As we saw in
regression problem as an un-regularized problem but on Fig. 15, our learning performance and solution depends
a constrained set of parameters. Since the size of the al- strongly on λ, thus it is vital to choose it properly. As
lowed parameter space (e.g. w ∈ Rp when un-regularized we discussed in Sec. V.C, one approach is to assume an
vs. w ∈ C ⊂ Rp when regularized) is roughly a proxy for uninformative prior on the hyper-parameters, p(λ), and
model complexity, solving the regularized problem is in average the posterior over all choices of λ following this
effect solving the un-regularized problem with a smaller distribution. However, this comes with a large computa-
model complexity class. This implies that we’re less likely tional cost. Therefore, it is simpler to choose the regular-
to overfit. ization parameter through some optimization procedure.
We also showed the connection between using a reg- We’d like to emphasize that linear regression can be
ularization function and the use of priors in Bayesian applied to model non-linear relationship between input
inference. This connection can be used to develop more and response. This can be done by replacing the input
intuition about why regularization implies we are less x with some nonlinear function φ(x). Note that doing
likely to overfit the data: Let’s say you are a young so preserves the linearity as a function of the parame-
Physics student taking a laboratory class where the goal ters w, since model is defined by the their inner product
of the experiment is to measure the behavior of several φT (x)w. This method is known as basis function expan-
different pendula and use that to predict the formula sion (Bishop, 2006; Murphy, 2012).
(i.e. model) that determines the period of oscillation. Recent years have also seen a surge of interest in un-
In your investigation you would probably record many derstanding generalized linear regression models from a
things (hopefully including the length and mass!) in an statistical physics perspective. Much of this research has
effort to give yourself the best possible chance of deter- focused on understanding high-dimensional linear regres-
mining the unknown relationship, perhaps writing down sion and compressed sensing (Donoho, 2006) (see (Ad-
the temperature of the room, any air currents, if the ta- vani et al., 2013; Zdeborová and Krzakala, 2016) for ac-
ble were vibrating, etc. What you have done is create a cessible reviews for physicists). On a technical level,
high-dimensional dataset for yourself. However you actu- this research imports and extends the machinery of spin
ally possess an even higher-dimensional dataset than you glass physics (replica method, cavity method, and mes-
probably would admit to yourself. For example you are sage passing) to analyze high-dimensional linear models
29
0 1 2 3
data point xi belongs to a category yi = {0, 1} is given Since the cost (error) function is just the negative log-
by likelihood, for logistic regression we find
where θ = w are the weights we wish to learn from the The right-hand side in Eq. (76) is known in statistics as
data. To gain some intuition for these equations, consider the cross entropy.
a collection of non-interacting two-state systems coupled Having specified the cost function for logistic regres-
to a thermal bath (e.g. a collection of atoms that can be sion, we note that, just as in linear regression, in practice
in two states). Furthermore, denote the state of system we usually supplement the cross-entropy with additional
i by a binary variable: yi ∈ {0, 1}. From elementary regularization terms, usually L1 and L2 regularization
statistical mechanics, we know that if the two states have (see Sec. VI for discussion of these regularizers).
energies 0 and 1 the probability for finding the system
in a state yi is:
B. Minimizing the cross entropy
e−β0 1
P (yi = 1) = −β0 = ,
e + e−β1 1 + e−β∆ The cross entropy is a convex function of the weights w
P (yi = 1) = 1 − P (yi = 0). (71) and, therefore, any local minimizer is a global minimizer.
Minimizing this cost function leads to the following equa-
Notice that in these expressions, as is often the case in tion
physics, only energy differences are observable. If the n
difference in energies between two states is given by ∆ = 0 = ∇C(w) =
X
σ(xTi w) − yi xi ,
(77)
xTi w, we recover the expressions for logistic regression. i=1
We shall use this mapping between partition functions
and classification to generalize the logistic regressor to where we made use of the logistic function identity
SoftMax regression in Sec. VII.D. Notice that in terms ∂z σ(s) = σ(s)[1−σ(s)]. Equation (77) defines a transcen-
of the logistic function, we can write dental equation for w, the solution of which, unlike linear
regression, cannot be written in a closed form. For this
P (yi = 1) = σ(xTi w) = 1 − P (yi = 0). (72) reason, one must use numerical methods such as those
introduced in Sec. IV to solve this optimization problem.
We now define the cost function for logistic regression
using Maximum Likelihood Estimation (MLE). Recall,
that in MLE we choose parameters to maximize the prob- C. Examples of binary classification
ability of seeing the observed data. Consider a dataset
D = {(yi , xi )} with binary labels yi ∈ {0, 1} from which Let us now show how to use logistic regression in
the data points are drawn independently. The likelihood practice. In this section, we showcase two pedagogi-
of observing the data under our model is just: cal examples to train a logistic regressor to classify bi-
nary data. Each example comes with a corresponding
n
Y yi 1−yi Jupyter notebook, see https://physics.bu.edu/ panka-
σ(xTi w) 1 − σ(xTi w)
P (D|w) = jm/MLnotebooks.html.
i=1
(73)
1. Identifying the phases of the 2D Ising model
from which we can readily compute the log-likelihood:
The goal of this example is to show how one can employ
n
X logistic regression to classify the states of the 2D Ising
yi log σ(xTi w) + (1 − yi ) log 1 − σ(xTi w) .
l(w) = model according to their phase of matter.
i=1
(74) The Hamiltonian for the classical Ising model is given
The maximum likelihood estimator is defined as the set by
of parameters that maximize the log-likelihood: X
H = −J Si Sj , Sj ∈ {±1}, (78)
n
X hiji
yi log σ(xTi w)+(1−yi ) log 1 − σ(xTi w) .
ŵ = arg max
θ i=1 where the lattice site indices i, j run over all nearest
(75) neighbors of a 2D square lattice, and J is an interaction
31
10 10 10
20 20 20
30 30 30
0 20 0 20 0 20
FIG. 20 Examples of typical states of the 2D Ising model for three different temperatures in the ordered phase (T /J = 0.75,
left), the critical region (T /J = 2.25, middle) and the disordered phase (T /J = 4.0, right). The linear system dimension is
L = 40 sites.
energy scale. We adopt periodic boundary conditions. to, among other things, critical slowing down of the MC
Onsager proved that this model undergoes a phase tran- algorithm. Perhaps identifying the phases is also harder
sition in the thermodynamic limit from an ordered fer- in the critical region. With this in mind, consider the
romagnet with all spins aligned to a disordered √ phase at following three types of states: ordered (T /J < 2.0),
the critical temperature Tc /J = 2/ log(1 + 2) ≈ 2.26. near-critical (2.0 ≤ T /J ≤ 2.5) and disordered (T /J >
For any finite system size, this critical point is smeared 2.5). We use both ordered and disordered states to train
out to a critical region around Tc . the logistic regressor and, once the supervised training
An interesting question to ask is whether one can procedure is complete, we will evaluate the performance
train a statistical classifier to distinguish between the two of our classification model on unseen ordered, disordered,
phases of the Ising model. If successful, this can be used and near-critical states.
to locate the position of the critical point in more compli- Here, we deploy the liblinear routine (the default for
cated models where an exact analytical solution has so far Scikit’s logistic regression) and stochastic gradient de-
remained elusive (Morningstar and Melko, 2017; Zhang scent (SGD, see Sec. IV for details) to optimize the logis-
et al., 2017b). In other words, given an Ising state, we tic regression cost function with L2 regularization. We
would like to classify whether it belongs to the ordered or define the accuracy of the classifier as the percentage of
the disordered phase, without any additional information correctly classified data points. Comparing the accuracy
other than the spin configuration itself. This categorical on the training and test data, we can study the degree
machine learning problem is well suited for logistic re- of overfitting. The first thing to notice in Fig. 21 is the
gression, and will thus consist of recognizing whether a small degree of overfitting, as suggested by the training
given state is ordered by looking at its bit configurations. (blue) and test (red) accuracy curves being very close to
Notice that, for the purposes of applying logistic regres- each other. Interestingly, the liblinear minimizer outper-
sion, the 2D spin state of the Ising model will be flattened forms SGD on the training and test data, but not on the
out to a 1D array, so it will not be possible to learn in- near-critical data for certain values of the regularization
formation about the structure of the contiguous ordered strength λ. Moreover, similar to the linear regression
2D domains [see Fig. 20]. Such information can be incor- examples, we find that there exists a sweet spot for the
porated using deep convolutional neural networks, see SGD regularization strength λ that results in optimal
Section IX. performance of the logistic regressor, at about λ ∼ 10−1 .
To this end, we consider the 2D Ising model on a 40×40 We might expect that the difficulty of the phase recogni-
square lattice, and use Monte-Carlo (MC) sampling to tion problem depends on the temperature of the queried
prepare 104 states at every fixed temperature T out of sample. Looking at the states in the near-critical region,
a pre-defined set. We furthermore assign a label to each c.f. Fig. 20, it is no longer easy for a trained human eye
state according to its phase: 0 if the state is disordered, to distinguish between the ferromagnetic and the disor-
and 1 if it is ordered. dered phases close to Tc . Therefore, it is interesting to
It is well-known that near the critical temperature Tc , also compare the training and test accuracies to the ac-
the ferromagnetic correlation length diverges, which leads curacy of the near-critical state predictions. (Recall that
32
FIG. 22 The probability of an event being a classified as a signal event for true signal events (left, blue) and background events
(right, red).
there is minimal overfitting, in part because we trained we’ve already come up with a set of discriminating vari-
on such a large dataset (4.5 million events). More impor- ables, including higher order ones derived from theories
tantly, however, is the underlying data we are working about SUSY particles, it’s worth reflecting on whether
with: each input variable is an important feature. there is utility to the increased sophistication of ML. To
show why we would want to use such a technique, recall
that, even to the learning algorithm, some signal events
and background events look similar. We can illustrate
this directly by looking at a plot comparing the pT spec-
trum of the two highest pT leptons (often referred to as
the leading and sub-leading leptons) for both signal and
background events. Figure 24 shows these two distribu-
tions, and one can see that while some signal events are
easily distinguished, many live in the same part of phase
space as the background. This effect can also be seen by
looking at figure 22 where you can see that some signal
events look like background events and vice-versa.
Yann LeCun and collaborators first collected and pro- (Freund et al., 1999; Freund and Schapire, 1995; Schapire
cessed 70000 handwritten digits, each of which is laid and Freund, 2012), random forests (Breiman, 2001),
out on a 28 × 28-pixel grid. Every pixel assumes one and gradient boosted trees such as XGBoost (Chen and
of 256 grayscale values, interpolating between white and Guestrin, 2016).
black. A representative input sample is show in Fig. 26.
Since there are 10 categories for the digits 0 through 9,
this corresponds to SoftMax regression with M = 10. We A. Revisiting the Bias-Variance Tradeoff for Ensembles
encourage readers to experiment with Notebook 7 to ex-
plore SoftMax regression applied to MNIST. We include The bias-variance tradeoff summarizes the fundamen-
in Fig. 27 the learned weights wk , where k corresponds to tal tension in machine learning between the complexity
class labels (i.e. digits). We shall come back to SoftMax of a model and the amount of training data needed to fit
regression in Sec. IX. it (see Sec. III). Since data is often limited, in practice
it is frequently useful to use a less complex model with
higher bias – a model whose asymptotic performance is
VIII. COMBINING MODELS worse than another model – because it is easier to train
and less sensitive to sampling noise arising from having a
One of the most powerful and widely-applied ideas in finite-sized training dataset (i.e. smaller variance). Here,
modern machine learning is the use of ensemble methods we will revisit the bias-variance tradeoff in the context
that combine predictions from multiple, often weak, sta- of ensembles, drawing upon the beautiful discussion in
tistical models to improve predictive performance (Diet- Ref. (Louppe, 2014).
terich et al., 2000). Ensemble methods, such as random A key property that will emerge from this analysis is
forests (Breiman, 2001; Geurts et al., 2006; Ho, 1998), the correlation between models that constitute the en-
and boosted gradient trees, such as XGBoost (Chen and semble. The degree of correlation between models9 is
Guestrin, 2016; Friedman, 2001), undergird many of the important for two distinct reasons. First, holding the en-
winning entries in data science competitions such as Kag- semble size fixed, averaging the predictions of correlated
gle, especially on structured datasets 8 . Even in the con- models reduces the variance less than averaging uncor-
text of neural networks, see Sec. IX, it is common to related models. Second, in some cases, correlations be-
combine predictions from multiple neural networks to in- tween models within an ensemble can result in an in-
crease performance on tough image classification tasks crease in bias, offsetting any potential reduction in vari-
(He et al., 2015; Ioffe and Szegedy, 2015). ance gained from ensemble averaging. We will discuss
In this section, we give an overview of ensemble meth- this in the context of bagging below. One of the most
ods and provide rules of thumb for when and why they dramatic examples of increased bias from correlations is
work. On one hand, the idea of training multiple models the catastrophic predictive failure of almost all derivative
and then using a weighted sum of the predictions of the models used by Wall Street during the 2008 financial cri-
all these models is very natural. After all, the idea of the sis.
“wisdom of the crowds” can be traced back, at least, to
the writings of Aristotle in Politics. On the other hand,
one can also imagine that the ensemble predictions can 1. Bias-Variance Decomposition for Ensembles
be much worse than the predictions from each of the in-
dividual models that constitute the ensemble, especially We will discuss the bias-variance tradeoff in the con-
when pooling reinforces weak but correlated deficiencies text of continuous predictions such as regression. How-
in each of the individual predictors. Thus, it is impor- ever, many of the intuitions and ideas discussed here also
tant to understand when we expect ensemble methods to carry over to classification tasks. Before discussing en-
work. sembles, let us briefly review the bias-variance tradeoff in
In order to do this, we will revisit the bias-variance the context of a single model. Consider a data set consist-
trade-off, discussed in Sec. III, and generalize it to con- ing of data XL = {(yj , xj ), j = 1 . . . N }. Let us assume
sider an ensemble of classifiers. We will show that the that the true data is generated from a noisy model
key to determining when ensemble methods work is the y = f (x) + , (82)
degree of correlation between the models in the ensemble
(Louppe, 2014). Armed with this intuition, we will intro- where is a normally distributed with mean zero and
duce some of the most widely-used and powerful ensem- standard deviation σ .
ble methods including bagging (Breiman, 1996), boosting
9 For example, the correlation coefficient between the predictions
made by two randomized models based on the same training set
8 Neural networks generally perform better than ensemble meth- but with different random seeds, see Sec. VIII.A.1 for precise
ods on unstructured data, images, and audio. definition.
36
FIG. 27 Visualization of the weights wj after training a SoftMax Regression model on the MNIST dataset (see Notebook
7). We emphasize that SoftMax Regression does not have explicit 2D spatial knowledge; the model learns from data points
flattened out in a one-dimensional array.
Assume that we have a statistical procedure (e.g. least- where the bias,
squares regression) for forming a predictor ĝL (x) that X
gives the prediction of our model for a new data point x Bias2 = (f (xi ) − EL [ĝL (xi )])2 , (85)
given that we trained the model using a dataset L. This i
estimator is chosen by minimizing a cost function which,
for the sake of concreteness, we take to be the squared measures the deviation of the expectation value of our es-
error timator (i.e. the asymptotic value of our estimator in the
limit of infinite data) from the true value. The variance
X
C(X, g(x)) = (yi − ĝL (xi ))2 . (83) X
i
V ar = EL [(ĝL (xi ) − EL [ĝL (xi )])2 ], (86)
i
The dataset L is drawn from some underlying distribu-
measures how much our estimator fluctuates due to
tion that describes the data. If we imagine drawing many
finite-sample effects. The noise term
datasets {Lj } of the same size as L from this distribu-
tion, we know that the corresponding estimators ĝLj (x) X
N oise = σ2i (87)
will differ from each other due to stochastic effects aris-
i
ing from sampling noise. For this reason, we can view
our estimator ĝL (x) as a random variable and define an is the part of the error due to intrinsic noise in the data
expectation value EL in the usual way. Note that the sub- generation process that no statistical estimator can over-
script denotes that the expectation is taken over L. In come.
practice, EL is computed by by drawing infinitely many Let us now generalize this to ensembles of estimators.
different datasets {Lj } of the same size, fitting the corre- Given a dataset XL and hyper-parameters θ that param-
sponding estimator, and then averaging the results. We eterize members of our ensemble, we will consider a pro-
will also average over different instances of the “noise” . cedure that deterministically generates a model ĝL (xi , θ)
The expectation value over the noise will be denoted by given XL and θ. We assume that the θ includes some
E . random parameters that introduce stochasticity into our
As discussed in Sec. III, we can decompose the ex- ensemble (e.g. an initial condition for stochastic gradient
pected generalization error as descent or a random subset of features or data points
used for training.) Concretely, with a giving dataset L,
EL, [C(X, g(x))] = Bias2 + V ar + N oise. (84) one has a learning algorithm A that generates a model
37
A(θ, L) based on a deterministic procedure which intro- Note that the expectation EL,θm [·] is computed over the
duced stochasticity through θ in its execution on dataset joint distribution of L and θm . Also, by definition, we
L. We will be concerned with the expected prediction assume m 6= m0 in CL,θm ,θm0 .
error of the aggregate ensemble predictor
M
1 X We can now ask about the expected generalization
A
ĝL (xi , {θ}) = ĝL (xi , θm ). (88) (out-of-sample) error for the ensemble
M m=1
" #
X
A A
EL,,θ [C(X, ĝL (x))] = EL,,θ (yi − f (xi ) + f (xi ) − ĝL (xi , {θ}))2
i
X
= EL,,θ [(yi − f (xi ))2 + (f (xi ) − ĝL
A
(xi , {θ}))2 + 2(yi − f (xi ))(f (xi ) − ĝL
A
(xi , {θ}))]
i
X X
= σ2i + A
EL,θ [(f (xi ) − ĝL (xi , {θ}))2 ], (91)
i i
where in the last line we have used the fact that E [yi ] = f (xi ) to eliminate the last term. We can further decompose
the second term as
A
EL,θ [(f (xi ) − ĝL (xi , {θ}))2 ] = EL,θ [(f (xi ) − EL,θ [ĝL
A A
(xi , {θ})] + EL,θ [ĝL A
(xi , {θ})] − ĝL (xi , {θ}))2 ]
A
= EL,θ [(f (xi ) − EL,θ [ĝL (xi , {θ})])2 ] + EL,θ [(EL,θ [ĝL
A A
(xi , {θ})] − ĝL (xi , {θ}))2 ]
A A A
+ 2EL,θ [(EL,θ [ĝL (xi , {θ})] − ĝL (xi , {θ}))(f (xi ) − EL,θ [ĝL (xi , {θ})])]
A
= (f (xi ) − EL,θ [ĝL (xi , {θ})])2 + EL,θ [(ĝL
A A
(xi , {θ}) − EL,θ [ĝL (xi , {θ})])2 ]
≡ Bias2 (xi ) + V ar(xi ), (92)
where we have defined the bias of an aggregate predictor So far the calculation for ensembles is almost iden-
as tical to that of a single estimator. However, since the
aggregate estimator is a sum of estimators, its variance
Bias2 (x) ≡ (f (x) − EL,θ [ĝL
A
(x, {θ})])2 (93) implicitly depends on the correlations between the indi-
vidual estimators in the ensemble. Using the definition
and the variance as of the aggregate estimator Eq. (88) and the definitions in
Eq. (89), we see that
A
V ar(x) ≡ EL,θ [(ĝL A
(x, {θ}) − EL,θ [ĝL (x, {θ})])2 ]. (94)
A A
V ar(x) = EL,θ [(ĝL (x, {θ}) − EL,θ [ĝL (x, {θ})])2 ]
1 X X
= 2 EL,θ [ĝL (x, θm )ĝL (x, θm0 )] − M 2 [µL,θ (x)]2
M 0 i
m,m
1 − ρ(x) 2
2
= ρ(x)σL,θ + σL,θ . (95)
M
38
for which errors are dominated by variance due to finite This bootstrapping procedure allows us to construct an
sampling rather than bias. approximate ensemble and thus reduce the variance. For
unstable predictors, this can significantly improve the
predictive performance. The price we pay for using boot-
B. Bagging strapped training datasets, as opposed to really partition-
ing the dataset, is an increase in the bias of our bagged es-
BAGGing, or Bootstrap AGGregation, first introduced timators. To see this, note that as the number of datasets
by Leo Breiman, is one of the most widely employed and M goes to infinity, the expectation with respect to the
simplest ensemble-inspired methods (Breiman, 1996). bootstrapped samples converges to the empirical distri-
Imagine we have a very large dataset L that we could bution describing the training data set pL (x) (e.g. a delta
partition into M smaller data sets which we label function at each datapoint in L) which in general is dif-
{L1 , . . . , LM }. If each partition is sufficiently large to ferent from the true generative distribution for the data
learn a predictor, we can create an ensemble aggregate p(x).
predictor composed of predictors trained on each subset
of the data. For continuous predictors like regression,
this is just the average of all the individual predictors:
M
1 X
A
ĝL (x) = gL (x). (98)
M i=1 i
nal dataset L. These bootstrapped datasets share many at classification, bagging these estimators yields reason-
points, but due to the sampling with replacement, are ably good predictive performance. This raises questions
all somewhat different from each other. In the bagging like why bagging works and how many bootstrap samples
procedure, we create an aggregate estimator by replac- are needed. As mentioned in the discussion above, bag-
ing the M independent datasets by the M bootstrapped ging is effective on “unstable” learning algorithms where
estimators: small changes in the training set result in large changes
in predictions (Breiman, 1996). When the procedure is
M
1 X unstable, the prediction error is dominated by the vari-
BS
ĝL (x) = g BS (x). (100)
M i=1 Li ance and one can exploit the aggregation component of
bagging to reduce the prediction error. In contrast, for
and a stable procedure the accuracy is limited by the bias
M introduced by using bootstrapped datasets. This means
that there is an instability-to-stability transition point
X
BS
ĝL (x) = arg max I[gLBS (x) = j]. (101)
j
i=1
i
beyond which bagging stops improving our prediction.
40
M̂ n ( D )
Brief Introduction to Bootstrapping
C. Boosting
how these points are labelled: cross for true label and circle data xn by
for that obtained by bagging. Each gray dashed line indicates
the prediction made, based on every bootstrap set while the exp[−αt yn gt (xn )]
wt+1 (xn ) ← wt (xn ) ,
dark dashed black line is the average of these. Zt
PN
where Zt = n=1 wt (xn )e−αt yn gt (xn ) ensures
more ‘democratic’ ways as is done in bagging. In all cases, all weights add up to unity.
the idea is to build a strong predictor by combining many P
T
weaker classifiers. • Output gA (x) = sign α g
t=1 t t (x)
In boosting, an ensemble of weak classifiers {gk (x)}
is combined into an aggregate, boosted classifier. How- There are many theoretical and empirical studies on the
ever, unlike bagging, each classifier is associated with a performance of AdaBoost but they are beyond the scope
weight αk that indicates how much it contributes to the of this review. We refer interested readers to the exten-
aggregate classifier sive literature on boosting (Freund et al., 1999).
M
X
gA (x) = αk gk (x), (104) D. Random Forests
K=1
ensembles of decision trees. Like in boosting, the ensem- nalizes both large weights on the leaves (similar to L2 -
bles are created by iteratively adding new decision trees regularization) and having large partitions with many
to the ensemble. In gradient boosted trees, one critical leaves.
component is the a cost function that measures the per- As in boosting, we form the ensemble iteratively. For
formance of our ensemble. At each step, we compute (t)
this reason, we define a family of predictors ŷi as
the gradient of the cost function with respect to the pre-
t
dicted value of the ensemble and add trees that move us (t)
X (t−1)
ŷi = gj (xi ) = ŷi + gt (xi ). (109)
in the direction of the gradient. Of course, this requires
j=1
a clever way of mapping gradients to decision trees. We
give a brief overview of how this is done within XGBoost Note that by definition yi
(M )
= gA (xi ). The central idea
(Extreme Gradient Boosting), which has recently been is that for large t, each decision tree is a small pertur-
applied, to classify and rank transcription factor binding bation to the predictor (of order 1/T ) and hence we can
in DNA sequences (Li et al., 2018). Below, we follow perform a Taylor expansion on our loss function to second
closely the XGboost tutorial. order:
Our starting point is a clever parametrization of de- N
cision trees. Here, we use notation where the deci- X (t−1)
Ct = l(yi , ŷi + gt (xi )) + Ω(gt )
sion tree makes continuous predictions (regression trees),
i=1
though this can also easily be generalized to classifica-
≈ Ct−1 + ∆Ct , (110)
tion tasks. We parametrize a decision tree j, denoted
as gj (x), with T leaves by two quantities: a function with
q(x) that maps each data point to one of the leaves of 1
the tree, q : x ∈ Rd → {1, 2 . . . , T } and a weight vector ∆Ct = ai gt (xi ) + bi gt (xi )2 + Ω(gt ), (111)
2
w ∈ RT that assigns a predicted value to each leaf. In
other words, the j-th decision tree’s prediction for the where
datapoint xi is simply: gj (xi ) = wq(xi ) . ai = ∂ŷ(t−1) l(yi , ŷi
(t−1)
), (112)
In addition to a parametrization of decision trees, we i
Accuracy
∆Ctopt . However, in practice this is impossible. Instead,
0.80
an approximate greedy algorithm is run that optimizes
one level of the tree at a time by trying to find optimal 0.75
Feature importance Learning” in the mid 2000s (Hinton et al., 2006; Hinton
axial MET 517 and Salakhutdinov, 2006). DNNs truly caught the atten-
missing energy magnitude 505 tion of the wider machine learning community and indus-
MET_rel 461
dPhi_r_b 443 try in 2012 when Alex Krizhevsky, Ilya Sutskever, and
lepton 2 eta 416
lepton 1 eta 396 Geoff Hinton used a GPU-based DNN model (AlexNet)
missing energy phi 361
cos(theta_r1) 352 to lower the error rate on the ImageNet Large Scale
Features
not to be as powerful as thought (Wilson et al., 2017), et al., 2018). Representing quantum states as DNNs (Gao
and widely held beliefs not as universal as once imagined et al., 2017; Gao and Duan, 2017; Levine et al., 2017;
(Lee et al., 2017; Zhang et al., 2016). This is especially Saito and Kato, 2017) and quantum state tomogra-
true in modern neural networks where results are largely phy (Torlai et al., 2018) are among some of the impres-
empirical and heuristic and lack the firm footing of many sive achievements to reveal the potential of deep learn-
earlier machine learning methods. For this reason, in ing to facilitate the study of quantum systems. Machine
this review we have chosen to emphasize tried and true learning techniques involving neural networks were also
fundamentals, while pointing out what, from our current used to study quantum and fault-tolerant error correc-
vantage point, seem like promising new techniques. The tion (Baireuther et al., 2017; Breuckmann and Ni, 2017;
field is rapidly evolving and readers are urged to read Chamberland and Ronagh, 2018; Davaasuren et al., 2018;
papers and to implement these algorithms themselves in Krastanov and Jiang, 2017; Maskara et al., 2018), es-
order to gain a deep appreciation for the incredible power timate rates of coherent and incoherent quantum pro-
of modern neural networks, especially in the context of cesses (Greplova et al., 2017), to obtain spectra of 1/f -
image, speech, and natural language processing, as well noise in spin-qubit devices (Zhang and Wang, 2018), and
as limitations of the current methods. the recognition of state and charge configurations and
In physics, DNNs and CNNs have already found auto-tuning in quantum dots (Kalantre et al., 2017). In
numerous applications. In statistical physics, they quantum information theory, it has been shown that one
have been applied to detect phase transitions in 2D can perform gate decompositions with the help of neural
Ising (Tanaka and Tomiya, 2017a) and Potts (Li nets (Swaddle et al., 2017). In lattice quantum chromo-
et al., 2017) models, lattice gauge theories (Wetzel and dynamics, DNNs have been used to learn action param-
Scherzer, 2017), and different phases of polymers (Wei eters in regions of parameter space where principal com-
et al., 2017). It has also been shown that deep neural net- ponent analysis fails (Shanahan et al., 2018). CNNs were
works can be used to learn free-energy landscapes (Sidky applied to data from a high-energy experiment to iden-
and Whitmer, 2017). At the same time, methods from tify particle interactions in sampling calorimeters used
statistical physics have been applied to the field of deep commonly in neutrino physics (Aurisano et al., 2016).
learning to study the thermodynamic efficiency of learn- Last but not least, DNNs also found place in the study
ing rules (Goldt and Seifert, 2017), to explore the hy- of quantum control (Yang et al., 2017), and in scattering
pothesis space that DNNs span, make analogies between theory to learn the s-wave scattering length (Wu et al.,
training DNNs and spin glasses (Baity-Jesi et al., 2018; 2018) of potentials.
Baldassi et al., 2017), and to characterize phase transi-
tions with respect to network topology in terms of er-
rors (Li and Saad, 2017). In relativistic hydrodynam- A. Neural Network Basics
ics, deep learning has been shown to capture features
of non-linear evolution and has the potential to accel- Neural networks (also called neural nets) are neural-
erate numerical simulations (Huang et al., 2018), while inspired nonlinear models for supervised learning. As
in mechanics CNNs have been used to predict eigenval- we will see, neural nets can be viewed as natural, more
ues of photonic crystals (Finol et al., 2018). Deep CNNs powerful extensions of supervised learning methods such
were employed in lensing reconstruction of the cosmic as linear and logistic regression and soft-max methods.
microwave background (Caldeira et al., 2018). Recently,
DNNs have been used to improve the efficiency of Monte-
Carlo algorithms (Shen et al., 2018). 1. The basic building block: neurons
Deep learning has also found interesting applications
in quantum physics. Various quantum phase transi- The basic unit of a neural net is a stylized “neu-
tions (Arai et al., 2017; Broecker et al., 2017; Iakovlev ron” i that takes a vector of d input features x =
et al., 2018; van Nieuwenburg et al., 2017b; Suchs- (x1 , x2 , . . . , xd ) and produces a scalar output ai (x). A
land and Wessel, 2018) can be detected and studied neural network consists of many such neurons stacked
using DNNs and CNNs, including the transverse-field into layers, with the output of one layer serving as the
Ising model (Ohtsuki and Ohtsuki, 2017), topological input for the next (see Figure 35). The first layer in the
phases (Yoshioka et al., 2017; Zhang et al., 2017a,b) neural net is called the input layer, the middle layers are
and non-invasive topological quality control (Caio et al., often called “hidden layers”, and the final layer is called
2019). DNNs found applications even in non-equilibrium the output layer.
many-body localization (van Nieuwenburg et al., 2017a,b; The exact function ai varies depending on the type of
Schindler et al., 2017; Venderley et al., 2017), and the non-linearity used in the neural network. However, in
characterization of photoexcited quantum states (Shinjo essentially all cases ai can be decomposed into a linear
et al., 2019). Experimentally, DNNs were recently em- operation that weights the relative importance of the var-
ployed in cold atoms to identify critical points (Rem ious inputs, and a non-linear transformation σi (z) which
47
{
{
input
ELUs, the gradients stay finite even for large inputs.
layer
0 0 0
-1 -1 -1
-5 0 5 -5 0 5 -5 0 5
ReLU Leaky ReLU ELU
6 6 6
4 4 4
2 2 2
0 0 0
-5 0 5 -5 0 5 -5 0 5
FIG. 36 Possible non-linear activation functions for neurons. In modern DNNs, it has become common to use non-linear
functions that do not saturate for large inputs (bottom row) rather than saturating functions (top row).
mate any quantum many-body state to an arbitrary ac- that works best. However, a general rule of thumb that
curacy, provided the bond dimension can be increased seems to be emerging is that the number of parameters in
arbitrarily – a severe requirement not met in any useful the neural net should be large enough to prevent under-
practical implementation of the theory. fitting (see theoretical discussion in (Advani and Saxe,
Modern neural networks generally contain multiple 2017)).
hidden layers (hence the “deep” in deep learning). There Empirically, the best architecture for a problem de-
are many ideas of why such deep architectures are fa- pends on the task, the amount and type of data that is
vorable for learning. Increasing the number of layers in- available, and the computational resources at one’s dis-
creases the number of parameters and hence the represen- posal. Certain architectures are easier to train, while
tational power of neural networks. Indeed, recent numer- others might be better at capturing complicated depen-
ical experiments suggests that as long as the number of dencies in the data and learning relevant input features.
parameters is larger than the number of data points, cer- Finally, there have been numerous works that move be-
tain classes of neural networks can fit arbitrarily labeled yond the simple deep, feed-forward neural network ar-
random noise samples (Zhang et al., 2016). This suggests chitectures discussed here. For example, modern neural
that large neural networks of the kind used in practice can networks for image segmentation often incorporate “skip
express highly complex functions. Adding hidden layers connections” that skip layers of the neural network (He
is also thought to allow neural nets to learn more complex et al., 2016). This allows information to directly propa-
features from the data. Work on convolutional networks gate to a hidden or output layer, bypassing intermediate
suggests that the first few layers of a neural network learn layers and often improving performance.
simple, “low-level” features that are then combined into
higher-level, more abstract features in the deeper layers.
Other works suggest that it is computationally and al- B. Training deep networks
gorithmically easier to train deep networks rather than
shallow, wider nets, though this is still an area of major In the previous section, we introduced the basic ar-
controversy and active research (Mhaskar et al., 2016). chitecture for neural networks. Here we discuss how to
Choosing the exact network architecture for a neural efficiently train large neural networks. Luckily, the basic
network remains an art that requires extensive numer- procedure for training neural nets is the same as we used
ical experimentation and intuition, and is often times for training simpler supervised learning algorithms, such
problem-specific. Both the number of hidden layers and as logistic and linear regression: construct a cost/loss
the number of neurons in each layer can affect the per- function and then use gradient descent to minimize the
formance of a neural network. There seems to be no cost function and find the optimal weights and biases.
single recipe for the right architecture for a neural net Neural networks differ from these simpler supervised pro-
49
cedures in that generally they contain multiple hidden m|xi ; w). Then, the categorical cross-entropy is defined
layers that make taking the gradient computationally as
more difficult. We will return to this in Sec. IX.C which n M −1
discusses the “backpropagation” algorithm for computing
X X
E(w) = − yim log ŷim (w)
gradients. i=1 m=0
Like all supervised learning procedures, the first thing +(1 − yim ) log [1 − ŷim (w)] . (122)
one must do to train a neural network is to specify a
loss function. Given a data point (xi , yi ), xi ∈ Rd+1 , As in linear and logistic regression, this loss function is
the neural network makes a prediction ŷi (w), where w often supplemented by additional terms that implement
are the parameters of the neural network. Recall that regularization.
in most cases, the top output layer of our neural net Having defined an architecture and a cost function, we
is either a continuous predictor or a classifier that makes must now train the model. Similar to other supervised
discrete (categorical) predictions. Depending on whether learning methods, we make use of gradient descent-based
one wants to make continuous or categorical predictions, methods to optimize the cost function. Recall that the
one must utilize a different kind of loss function. basic idea of gradient descent is to update the parame-
For continuous data, the loss functions that are com- ters w to move in the direction of the gradient of the cost
monly used to train neural networks are identical to those function ∇w E(w). In Sec. IV, we discussed numerous
used in linear regression, and include the mean squared optimizers that implement variations of stochastic gra-
error dient descent (SGD, Nesterov, RMSProp, Adam, etc.)
1X
n Most modern neural network packages, such as Keras,
E(w) = (yi − ŷi (w))2 , (119) allow the user to specify which of these optimizers they
n i=1
would like to use in order to train the neural network.
where n is the number of data points, and the mean- Depending on the architecture, data, and computational
absolute error (i.e. L1 norm) resources, different optimizers may work better on the
problem, though vanilla SGD is a good first choice.
1X Finally, we note that unlike in linear and logistic re-
E(w) = |yi − ŷi (w)|. (120)
n i gression, calculating the gradients for a neural network
requires a specialized algorithm, called Backpropagation
The full cost function often includes additional terms that (often abbreviated backprop) which forms the heart of
implement regularization (e.g. L1 or L2 regularizers), see any neural network training procedure. Backpropaga-
Sec. VI. tion has been discovered multiple times independently
For categorical data, the most commonly used loss but was popularized for modern neural networks in 1985
function is the cross-entropy (Eq. (76) and Eq. (81)), (Rumelhart and Zipser, 1985). We will turn to the back-
since the output layer is often taken to be a logistic clas- propagation algorithm in the next section. Before read-
sifier for binary data with two types of labels, or a soft- ing it, the reader is strongly encouraged to play with
max classifier if there are more than two types of labels. Notebook 11 in order to gain some intuition about how
The cross-entropy was already discussed extensively in to build a DNN in practice using the high-level Keras
earlier sections on logistic regression and soft-max classi- Python package. Notebook 11 discusses a simple exam-
fiers, see Sec. VII. Recall that for classification of binary ple where we build a feed-forward deep neural network for
data, the output of the top layer of the neural network is classifying hand-written digits from the MNIST dataset.
the probability ŷi (w) = p(yi = 1|xi ; w) that data point Figures 37 and 38 show the accuracy and the loss as a
i is predicted to be in category 1. The cross-entropy be- function of the training episodes.
tween the true labels yi ∈ {0, 1} and the predictions is
given by
n
X C. The Backpropagation algorithm
E(w) = − yi log ŷi (w) + (1 − yi ) log [1 − ŷi (w)] .
i=1 In the last section, we saw how to deploy a high-level
More generally, for categorical data, y can take on M package, Keras, to design and train a simple neural net-
values so that y ∈ {0, 1, . . . , M − 1}. For each datapoint work. This training procedure requires us to be able to
i, define a vector yim called a ‘one-hot’ vector, such that calculate the derivative of the cost function with respect
( to all the parameters of the neural network (the weights
1, if yi = m and biases of all the neurons in the input, hidden, and
yim = (121) visible layers). A brute force calculation is out of the
0, otherwise.
question since it requires us to calculate as many gradi-
We can also define the probability that the neural net- ents as parameters at each step of the gradient descent.
work assigns a datapoint to category m: ŷim (w) = p(yi = The backpropagation algorithm (Rumelhart and Zipser,
50
0.3
layer l, ∆lj , as the change in the cost function w.r.t. the
weighted input zjl :
0.2 ∂E ∂E 0 l
∆lj = l
= σ (zj ), (I)
∂zj ∂alj
0.1 where σ 0 (x) denotes the derivative of the non-linearity
σ(·) with respect to its input evaluated at x. Notice
0 2 4 6 8 that the error function ∆lj can also be interpreted as the
epoch
partial derivative of the cost function with respect to the
bias blj , since
FIG. 38 Model loss of a DNN to study the MNIST problem as
a function of the training epochs (see Notebook 11). Besides ∂E ∂E ∂blj ∂E
the input and output layers, the DNN has four layers of size ∆lj = = = l, (II)
∂zjl ∂blj ∂zjl ∂bj
(100,400,400,50) with different nonlinearities σ(z).
where in the last line we have used the fact that
∂blj /∂zjl = 1, cf. Eq. (124). This is the second of the
1985) is a clever procedure that exploits the layered struc- four backpropagation equations.
ture of neural networks to more efficiently compute gra- We now derive the final two backpropagation equations
dients (for a more detailed discussion with Python code using the chain rule. Since the error depends on neurons
examples see Chapter 2 of (Nielsen, 2015)). in layer l only through the activation of neurons in the
subsequent layer l + 1, we can use the chain rule to write
∂E X ∂E ∂z l+1
1. Deriving and implementing the backpropagation equations ∆lj = = k
∂zjl k
∂zk
l+1 ∂z l
j
At its core, backpropagation is simply the ordinary
∂zkl+1
chain rule for partial differentiation, and can be summa-
X
= ∆l+1
k
rized using four equations. In order to see this, we must k
∂zjl
first establish some useful notation. We will assume that
!
X
there are L layers in our network with l = 1, . . . , L in- = ∆l+1 l+1
k wkj σ 0 (zjl ). (III)
dexing the layer. Denote by wjk l
the weight for the con- k
51
This is the third backpropagation equation. The final network. However, until fairly recently it was widely be-
equation can be derived by differentiating of the cost lieved that training deep networks was an extremely dif-
function with respect to the weight wjk
l
as ficult task. One reason for this was that even with back-
propagation, gradient descent on large networks is ex-
∂E ∂E ∂zjl tremely computationally expensive. However, the great
= l = ∆lj al−1 (IV)
l
∂wjk l
∂zj ∂wjk k advances in computational hardware (and the widespread
use of GPUs) has made this a much less vexing prob-
Together, Eqs. (I), (II), (III), and (IV) define the four lem than even a decade ago. It is hard to understate
backpropagation equations relating the gradients of the the impact these advances in computing have had on the
activations of various neurons alj , the weighted inputs practical utility of neural networks.
P l l−1 l
zjl = k wjk ak +bj , and the errors ∆lj . These equations
On a more technical and mathematical note, another
can be combined into a simple, computationally efficient
problem that occurs in deep networks, which transmit
algorithm to calculate the gradient with respect to all
information through many layers, is that gradients can
parameters (Nielsen, 2015).
vanish or explode. This is, appropriately, known as the
The Backpropagation Algorithm problem of vanishing or exploding gradients. This prob-
lem is especially pronounced in neural networks that try
1. Activation at input layer: calculate the activa- to capture long-range dependencies, such as Recurrent
tions a1j of all the neurons in the input layer. Neural Networks for sequential data. We can illustrate
2. Feedforward: starting with the first layer, exploit this problem by considering a simple network with one
the feed-forward architecture through Eq. (123) to neuron in each layer. We further assume that all weights
compute z l and al for each subsequent layer. are equal, and denote them by w. The behavior of the
backpropagation equations for such a network can be in-
3. Error at top layer: calculate the error of the top ferred from repeatedly using Eq. (III):
layer using Eq. (I). This requires to know the ex-
pression for the derivative of both the cost function
E(w) = E(aL ) and the activation function σ(z). L−1
Y L−1
Y
∆1j = ∆L
j wσ 0 (zj ) = ∆L
j (w)
L
σ 0 (zj ), (126)
4. “Backpropagate” the error: use Eq. (III) to j=0 j=0
propagate the error backwards and calculate ∆lj for
all layers.
5. Calculate gradient: use Eqs. (II) and (IV) to where ∆L j is the error in the L-th topmost layer, and
calculate ∂b
∂E
l and ∂w l .
∂E (w)L is the weight to the power L. Let us now also
j jk
assume that the magnitude σ 0 (zj ) is fairly constant and
We can now see where the name backpropagation we can approximate σ 0 (zj ) ≈ σ00 . In this case, notice
comes from. The algorithm consists of a forward pass that for large L, the error ∆1j has very different behavior
from the bottom layer to the top layer where one calcu- depending on the value of wσ00 . If wσ00 > 1, the errors
lates the weighted inputs and activations of all the neu- and the gradient blow up. On the other hand, if wσ00 < 1
rons. One then backpropagates the error starting with the errors and gradients vanish. Only when the weights
the top layer down to the input layer and uses these errors satisfy wσ00 ≈ 1 and the neurons are not saturated will
to calculate the desired gradients. This description makes the gradient stay well behaved for deep networks.
clear the incredible utility and computational efficiency
This basic behavior holds true even in more compli-
of the backpropagation algorithm. We can calculate all
cated networks. Rather than considering a single weight,
the derivatives using a single “forward” and “backward”
we can ask about the eigenvalues (or singular values) of
pass of the neural network. This computational efficiency
the weight matrices wjk l
. In order for the gradients to
is crucial since we must calculate the gradient with re-
be finite for deep networks, we need these eigenvalues to
spect to all parameters of the neural net at each step
stay near unity even after many gradient descent steps.
of gradient descent. These basic ideas also underly al-
In modern feedforward and ReLU neural networks, this
most all modern automatic differentiation packages such
is achieved by initializing the weights for the gradient de-
as Autograd (Pytorch).
scent in clever ways and using non-linearities that do not
saturate, such as ReLUs (recall that for saturating func-
2. Computing gradients in deep networks: what can go wrong tions, σ 0 → 0, which will cause the gradient to vanish).
with backprop? Proper initialization and regularization schemes such as
gradient clipping (cutting-off gradients with very large
Armed with backpropagation and gradient descent, it values), and batch normalization also help mitigate the
seems like it should be straightforward to train any neural vanishing and exploding gradient problem.
52
D. Regularizing neural networks and other practical tions, the dataset we train on, and a smaller validation
considerations set that serves as a proxy for out-of-sample performance
on the test set. As we train the model, we plot both the
DNNs, like all supervised learning algorithms, must training error and the validation error. We expect the
navigate the bias-variance tradeoff. Regularization tech- training error to continuously decrease during training.
niques play an important role in ensuring that DNNs However, the validation error will eventually increase due
generalize well to new data. The last five years have seen to overfitting. The basic idea of early stopping is to halt
a wealth of new specialized regularization techniques for the training procedure when the validation error starts to
DNNs beyond the simple L1 and L2 penalties discussed in rise. This Early Stopping procedure ensures that we stop
the context of linear and logistic regression, see Secs. VI the training and avoid fitting sample specific features in
and VII. These new techniques include Dropout and the data. Early Stopping is a widely used essential tool
Batch Normalization. In addition to these specialized in the deep learning regularization toolbox.
regularization techniques, large DNNs seem especially
well-suited to implicit regularization that already takes
place in the Stochastic Gradient Descent (SGD) (Wilson 2. Dropout
et al., 2017), cf. Sec. IV. The implicit stochasticity and
local nature of SGD often prevent overfitting of spurious Another important regularization schemed that has
correlations in the training data, especially when com- been widely adopted in the neural networks literature
bined with techniques such as Early Stopping. In this is Dropout (Srivastava et al., 2014). The basic idea of
section, we give a brief overview of these regularization Dropout is to prevent overfitting by reducing spurious
techniques. correlations between neurons within the network by in-
troducing a randomization procedure similar to that un-
derlying ensemble models such as Bagging. Recall that
1. Implicit regularization using SGD: initialization, the basic idea behind ensemble methods is to train an en-
hyper-parameter tuning, and Early Stopping semble of models that are created using a randomization
procedure to ensure that the members of the ensemble
The most commonly employed and effective optimizer are uncorrelated, see Sec. VIII. This reduces the vari-
for training neural networks is SGD (see Sec. IV for other ance of statistical predictions without creating too much
alternatives). SGD acts as an implicit regularizer by in- additional bias.
troducing stochasticity (from the use of mini-batches) In the context of neural networks, it is extremely costly
that prevents overfitting. In order to achieve good per- to train an ensemble of networks, both from the point of
formance, it is important that the weight initialization is view of the amount of data needed, as well as computa-
chosen randomly, in order to break any leftover symme- tional resources and parameter tuning required. Dropout
tries. One common choice is drawing the weights from a circumnavigates these problems by randomly dropping
Gaussian centered around zero with some variance that out neurons (along with their connections) from the neu-
scales inversely with number of inputs to the neuron (He ral network during each step of the training (see Figure
et al., 2015; Sutskever et al., 2013). Since SGD is a lo- 39). Typically, for each mini-batch in the gradient de-
cal procedure, as networks get deeper, choosing a good scent step, a neuron is dropped from the neural network
weight initialization becomes increasingly important to with a probability p. The gradient descent step is then
ensure that the gradients are well behaved. Choosing performed only on the weights of the “thinned” network
an initialization with a variance that is too large or too of individual predictors.
small will cause gradients to vanish and the network to Since during training, on average weights are only
train poorly – even a factor of 2 can make a huge differ- present a fraction p of the time, predictions are made
ence in practice (He et al., 2015). For this reason, it is by reweighing the weights by p: wtest = pwtrain .The
important to experiment with different variances. learned weights can be viewed as some “average” weight
The second important thing is to appropriately choose over all possible thinned neural network. This averag-
the learning rate or step-size by searching over five log- ing of weights is similar in spirit to the Bagging proce-
arithmic grid points (Wilson et al., 2017). If the best dure discussed in the context of ensemble models, see
performance occurs at the edge of the grid, repeat this Sec. VIII.
procedure until the optimal learning rate is in the middle
of the grid parameters. Finally, it is common to center
or whiten the input data (just as we did for linear and 3. Batch Normalization
logistic regression).
Another important form of regularization that is of- Batch Normalization is a regularization scheme that
ten employed in practice is Early Stopping. The idea of has been quickly adopted by the neural network com-
Early Stopping is to divide the training data into two por- munity since its introduction in 2015 (Ioffe and Szegedy,
53
new parameters γkl and βkl can be learned just like the
weights and biases using backpropagation (since this is
just an extra layer for the chain rule). We initialize the
neural network so that at the beginning of training the
Standard
inputs are being standardized. Backpropagation then ad-
Neural Net
justs γ and β during training.
In practice, Batch Normalization considerably im-
proves the learning speed by preventing gradients from
vanishing. However, it also seems to serve as a power-
ful regularizer for reasons that are not fully understood.
One plausible explanation is that in batch normalization,
After applying X the gradient for a sample depends not only on the sam-
Dropout ple itself but also on all the properties of the mini-batch.
Since a single sample can occur in different mini-batches,
this introduces additional randomness into the training
procedure which seems to help regularize training.
FIG. 39 Dropout During the training procedure neurons E. Deep neural networks in practice: examples
are randomly “dropped out” of the neural network with some
probability p giving rise to a thinned network. This prevents Now that we have gained sufficient high-level back-
overfitting by reducing correlations among neurons and re-
ground knowledge about deep neural nets, let us discuss
ducing the variance in a method similar in spirit to ensemble
methods. how to use them in practice.
2015). The basic inspiration behind Batch Normalization 1. Deep learning packages
is the long-known observation that training in neural net-
works works best when the inputs are centered around In Notebook 11, we demonstrated that the numerical
zero with respect to the bias. The reason for this is that implementation of DNNs is greatly facilitated by open
it prevents neurons from saturating and gradients from source python packages, such as Keras, TensorFlow, Py-
vanishing in deep nets. In the absence of such center- torch, and others. The complexity and learning curves
ing, changes in parameters in lower layers can give rise for these packages differ, depending on the user’s level of
to saturation effects in higher layers, and vanishing gra- familiarity with Python. The reader should keep mind
dients. The idea of Batch Normalization is to introduce mind that there are DNN packages written in other lan-
additional new “BatchNorm” layers that standardize the guages, such as Caffe which uses C++, but we do not
inputs by the mean and variance of the mini-batch. discuss them in this review for brevity.
Consider a layer l with d neurons whose inputs are Keras is a high-level framework which does not require
(z1l , . . . , zdl ). We standardize each dimension so that any knowledge about the inner workings of the underly-
ing deep learning algorithms. Coding DNNs in Keras is
zkl − E[zkl ]
zkl −→ ẑkl = q , (127) particularly simple, see Notebook 11, and allows one to
Var[zkl ] quickly grasp the big picture behind the theoretical con-
cepts which we introduced above. However, for advanced
where the mean and variance are taken over all sam- applications, which may require more direct control over
ples in the mini-batch. One problem with this procedure the operations in between the layers, Keras’ high-level
is that it may change the representational power of the design may turn out insufficient.
neural network. For example, for tanh non-linearities, it If one opens up the Keras black box, one will find that
may force the network to live purely in the linear regime it wraps the functionality of another package – Tensor-
around z = 0. Since non-linearities are crucial to the Flow11 . Over the last years, TensorFlow, which is sup-
representational power of DNNs, this could dramatically ported by Google, has been gaining popularity and has
alter the power of the DNN. become the preferred library for deep learning. It is fre-
For this reason, one introduces two new parameters γkl quently used in Kaggle competitions, university classes,
and βkl for each neuron that can additionally shift and and industry. In TensorFlow one constructs data flow
scale the normalized input
ẑkl −→ ẑlk = γkl ẑkl + βkl . (128)
One can think of Eqs. (127) and (128) as adding new 11 While Keras can also be used with a Theano backend, we do not
extra layers ẑlk in the deep net architecture. Hence, the discuss this here since Theano support has been discontinued.
54
graphs, the nodes of which represent mathematical oper- data serves as a major bottleneck on the ultimate per-
ations, while the edges encode multidimensional tensors formance of DNNs. In such cases one can consider data
(data arrays). A deep neural net can then be thought of augmentation, i.e. distorting data samples from the ex-
as a graph with a particular architecture and connectiv- isting dataset in some way to enhance size the dataset.
ity. One needs to understand this concept well before one Obviously, if one knows how to do this, one already has
can truly unleash TensorFlow’s full potential. The learn- partial information about the important features in the
ing curve can sometimes be rather steep for TensorFlow data.
beginners, and requires a certain degree of perseverance One of the first questions we are typically faced with is
and devoted time to internalize the underlying ideas. how to determine the sizes of the training and test data
There are, however, many other open source packages sets. The MNIST dataset, which has 10 classification
which allow for control over the inter- and intra-layer op- categories, uses 80% of the available data for training
erations, without the need to introduce computational and 20% for testing. On the other hand, the ImageNet
graphs. Such an example is Pytorch, which offers li- data which has 1000 categories is split 50% − 50%. As
braries for automatic differentiation of tensors at GPU a rule of thumb, the more classification categories there
speed. As we discussed above, manipulating neural nets are in the task, the closer the sizes of the training and
boils down to fast array multiplication and contraction test datasets should be in order to prevent overfitting.
operations and, therefore, the torch.nn library often Once the size of the training set is fixed, it is common to
does the job of providing enough access and controlla- reserve 20% of it for validation, which is used to fine-tune
bility to manipulate the linear algebra operations under- the hyperparameters of the model.
lying deep neural nets. Also related to data preprocessing is the standardiza-
For the benefit of the reader, we have prepared Jupyter tion of the dataset. It has been found empirically that if
notebooks for DNNs using all three packages for the deep the original values of the data differ by orders of magni-
learning problems we discuss below. We invite the reader tude, training can be slowed down or impeded. This can
to carefully examine the differences in the code which be traced back to the vanishing and exploding gradient
should help them decide on which package they prefer to problem in backprop discussed in Sec. IX.C. To avoid
use. such unwanted effects, one often resorts to two tricks:
(i) all data should be mean-centered, i.e. from every data
point we subtract the mean of the entire dataset, and (ii)
2. Approaching the learning problem rescale the data, for which there are two ways: if the data
is approximately normally distributed, one can rescale by
Let us now analyze a typical procedure for using neural the standard deviation. Otherwise, it is typically rescaled
networks to solve supervised learning problems. As can by the maximum absolute value so the rescaled data lies
be seen already from the code snippets in Notebook 11, within the interval [−1, 1]. Rescaling ensures that the
constructing a deep neural network to solve ML problems weights of the DNN are of a similar order of magnitude
is a multiple-stage process. Generally, one can identify a (notice the similarity of this idea to Batch Normalization,
set of key steps: cf. Sec. IX.D.3).
The next issue is how to choose the right hyperparam-
1. Collect and pre-process the data.
eters to start training the model. According to Bengio,
2. Define the model and its architecture. the optimal learning rate is often an order of magnitude
lower than the smallest learning rate that blows up the
3. Choose the cost function and the optimizer. loss (Bengio, 2012). One should also keep in mind that,
depending on how ambitious of a problem one is dealing
4. Train the model. with, training the model can take a considerable amount
of time. This can severely slow down any progress on
5. Evaluate and study the model performance
improving the model in Step 6. Therefore, it is usu-
on the test data.
ally a good idea to play with a small enough fraction of
6. Use the validation data to adjust the hyper- the training data to get a rough feeling about the cor-
parameters (and, if necessary, network ar- rect hyperparameter regimes, the usefulness of the DNN
chitecture) to optimize performance for the architecture, and to debug the code. The size of this
specific dataset. small ‘play set’ should be such that training on it can
be done fast and in real time to allow to quickly adjust
At this point a few remarks are in order. While we the hyperparameters. A typical strategy of exploring the
treat Step 1 above as consisting mainly of loading and hyperparameter landscape is to use grid searches.
reshaping a dataset prepared ahead of time, we empha- Whereas it is always possible to view Steps 1-5 as
size that obtaining a sufficient amount of data is a typical generic and independent of the particular problem we
challenge in many applications. Oftentimes insufficient are trying to solve, it is only when these steps are put
55
accuracy (%)
data set size
accuracy (%)
10 60.7% 43.1% 28.0% 75.6% 95.7% 99.2% 60%
must first learn features associated with cats. Because
a cat is a physical object, we know that these features
100 68.9% 70.8% 85.1% 93.3% 99.7% 99.9%
40% are likely to be local (groups of neighboring pixels in the
two-dimensional image corresponding to whiskers, tails,
1000 79.2% 53.9% 84.2% 97.9% 99.8% 99.9% eyes, etc). We also know that the cat can be anywhere
20% in the image. Thus, it does not really matter where in
learning rate the picture these features occur (though relative positions
of features likely do matter). This is a manifestation of
0% translational invariance that is built into our supervised
100%
learning task. This example makes clear that, like many
physical systems, many ML tasks (especially in the con-
1e-06 1e-05 0.0001 0.001 0.01 0.1
text of computer vision and image processing) also pos-
80% sess additional structure, such as locality and translation
1 50.2% 50.1% 49.8% 49.2% 53.7% 60.1% invariance.
The all-to-all coupled neural networks in the previous
hidden neurons
accuracy (%)
10 68.6% 46.4% 39.3% 74.5% 83.7% 84.2% 60% section fail to exploit this additional structure. For exam-
ple, consider the image of the digit ‘four’ from the MNIST
dataset shown in Fig. 26. In the all-to-all coupled neural
100 67.6% 63.9% 55.5% 67.1% 73.1% 93.7%
40% networks used there, the 28 × 28 image was considered
a one-dimensional vector of size 282 = 796. This clearly
1000 67.6% 51.9% 56.2% 59.9% 74.0% 96.0%
throws away lots of the spatial information contained in
20%
learning rate the image. Not surprisingly, the neural networks com-
munity realized these problems and designed a class of
0% neural network architectures, convolutional neural net-
works or CNNs, that take advantage of this additional
FIG. 41 Grid search results for the test set accuracy (top) structure (locality and translational invariance) (LeCun
and the critical set accuracy (bottom) of the DNN for the et al., 1995). Furthermore, what is especially interest-
Ising classification problem as a function of the learning rate ing from a physics perspective is the recent finding that
and the number of hidden neurons. these CNN architectures are intimately related to mod-
els such as tensor networks (Stoudenmire, 2018; Stouden-
mire and Schwab, 2016) and, in particular, MERA-like
close to criticality, clearly more neurons are required to architectures that are commonly used in physical mod-
reliably learn the more complex correlations in the Ising els for quantum condensed matter systems (Levine et al.,
configurations. 2017).
One of the core lessons of physics is that we should ex- A convolutional neural network is a translationally in-
ploit symmetries and invariances when analyzing physi- variant neural network that respects locality of the in-
cal systems. Properties such as locality and translational put data. CNNs are the backbone of many modern deep
invariance are often built directly into the physical laws. learning applications and here we just give a high-level
Our statistical physics models often directly incorporate overview of CNNs that should allow the reader to delve
everything we know about the physical system being an- directly into the specialized literature. The reader is also
alyzed. For example, we know that in many cases it is strongly encouraged to consult the excellent, succinct
sufficient to consider only local couplings in our Hamilto- notes for the Stanford CS231n Convolutional Neural Net-
nians, or work directly in momentum space if the system works class developed by Andrej Karpathy and Fei-Fei Li
is translationally invariant. This basic idea, tailoring our (https://cs231n.github.io/). We have drawn heavily
analysis to exploit additional structure, is a key feature of on the pedagogical style of these notes in crafting this
modern physical theories from general relativity, through section.
57
H Fully
Connected
Layer
W
Convolution Coarse-graining Convolution Coarse-graining
(pooling) (pooling)
FIG. 42 Architecture of a Convolutional Neural Network (CNN). The neurons in a CNN are arranged in three
dimensions: height (H), width (W ), and depth (D). For the input layer, the depth corresponds to the number of channels (in
this case 3 for RGB images). Neurons in the convolutional layers calculate the convolution of the image with a local spatial
filter (e.g. 3 × 3 pixel grid, times 3 channels for first layer) at a given location in the spatial (W, H)-plane. The depth D of the
convolutional layer corresponds to the number of filters used in the convolutional layer. Neurons at the same depth correspond
to the same filter. Neurons in the convolutional layer mix inputs at different depths but preserve the spatial location. Pooling
layers perform a spatial coarse graining (pooling step) at each depth to give a smaller height and width while preserving the
depth. The convolutional and pooling layers are followed by a fully connected layer and classifier (not shown).
There are two kinds of basic layers that make up a the input with P zeros (see Fig. 43). For an input
CNN: a convolution layer that computes the convolu- of width W , the number of neurons (outputs) in the
tion of the input with a bank of filters (as a math- layer is given by (W − F + 2P )/S + 1. We invite the
ematical operation, see this practical guide to image reader to check out this visualization of the convolution
kernels: http://setosa.io/ev/image-kernels/), and procedure, https://github.com/vdumoulin/conv_
pooling layers that coarse-grain the input while main- arithmetic/blob/master/README.md, for a square
taining locality and spatial structure, see Fig. 42. For input of unit depth. After computing the filter, the
two-dimensional data, a layer l is characterized by three output is passed through a non-linearity, a ReLU in Fig.
numbers: height Hl , width Wl , and depth Dl 12 . The 43. In practice, one often inserts a BatchNorm layer
height and width correspond to the sizes of the two- before the non-linearity, cf. Sec. IX.D.3.
dimensional spatial (Wl , Hl )-plane (in neurons), and the These convolutional layers are interspersed with pool-
depth Dl (marked by the different colors in Fig. 42) – ing layers that coarse-grain spatial information by per-
to the number of filters in that layer. All neurons corre- forming a subsampling at each depth. One common pool-
sponding to a particular filter have the same parameters ing operation is the max pool. In a max pool, the spatial
(i.e. shared weights and bias). dimensions are coarse-grained by replacing a small region
In general, we will be concerned with local spatial (say 2×2 neurons) by a single neuron whose output is the
filters (often called a receptive field in analogy with maximum value of the output in the region. In physics,
neuroscience) that take as inputs a small spatial patch this pooling step is very similar to the decimation step
of the previous layer at all depths. For instance, a of RG (Iso et al., 2018; Koch-Janusz and Ringel, 2017;
square filter of size F is a three-dimensional array of Lin et al., 2017; Mehta and Schwab, 2014). This gener-
size F × F × Dl−1 . The convolution consists of running ally reduces the dimension of outputs. For example, if
this filter over all locations in the spatial plane. To the region we pool over is 2 × 2, then both the height
demonstrate how this works in practice, let us a consider and the width of the output layer will be halved. Gen-
the simple example consisting of a one-dimensional erally, pooling operations do not reduce the depth of the
input of depth 1, shown in Fig. 43. In this case, a filter convolutional layers because pooling is performed sepa-
of size F × 1 × 1 can be specified by a vector of weights rately at each depth. A simple example of a max-pooling
w of length F . The stride, S, encodes by how many operation is shown in Fig. 44. There are some studies
neurons we translate the filter by when performing suggesting that pooling might be unnecessary (Springen-
the convolution. In addition, it is common to pad berg et al., 2014), but pooling layers remain a staple of
most CNNs.
In a CNN, the convolution and max-pool layers are
12 The depth Dl is often called “number of channels”, to distin-
generally followed by an all-to-all connected layer and a
guish it from the depth of the neural network itself, i.e. the total high-level classifier such as a soft-max. This allows us
number of layers (which can be convolutional, pooling or fully- to train CNNs as usual using the backprop algorithm,
connected), cf. Fig. 42. cf. Sec. IX.C. From a backprop perspective, CNNs are
58
3 0 1 0 110
0 1 1 1 3 1
100
Accuracy
4 2
90
2 3 2 1
80
4 1 0 1 test
70 critical
. .
.. .. 60 1 5 10 20 50
Depth of hidden layer
2 5 2 1 FIG. 45 Single-layer convolutional network for classi-
fying phases in the Ising mode. Accuracy on test set and
critical samples for a convolutional neural network with sin-
1 1 0 1 5 2 gle layer of varying depth with filters of size 2, max-pool layer
with receptive field of size 2, followed by soft-max classifier.
Notice that the test accuracy is 100% even for a CNN of depth
1 0 1 0 3 1 one with a single set of weights. Accuracy on the near-critical
dataset is significantly below that for the test set.
3 1 0 1
CS231n mentioned in the introduction to this section.
addition to replacing and retraining the classifier proxy for the test error in order to make tweaks to our
in the top layer, we can also fine-tune the weights model. It is crucial that we do not use any of the test
of the original CNN using backpropagation. One data to train the algorithm. This is a cardinal sin in
may choose to freeze some of the weights in the ML. We thus suggest the following workflow:
CNN during the procedure or retrain all of them
simultaneously. Estimate optimal error rate (Bayes rate).—The
first thing one should establish is the difficulty of the
All these procedures can be carried out easily by us- task and the best performance one can expect to achieve.
ing packages such as Caffe or the Torch Vision library No algorithm can do better than the “signal” in the
in PyTorch. PyTorch provides a nice python notebook dataset. For example, it is likely much easier to classify
that serves as tutorial on transfer learning. The reader objects in high-resolution images than in very blurry,
is strongly urged to read the Pytorch tutorials carefully low-resolution images. Thus, one needs to establish
if interested in this topic. a proxy or baseline for the optimal performance that
can be expected from any algorithm. In the context of
Bayesian statistics, this is often called the Bayes rate.
XI. HIGH-LEVEL CONCEPTS IN DEEP NEURAL
Since we do not know this a priori, we must get an
NETWORKS
estimate of this. For many tasks such as speech or object
In the previous sections, we introduced deep neural recognition, we can approximate this by the performance
networks and discussed how we can use these networks of humans on the task. For a more specialized task,
to perform supervised learning. Here, we take a step back we would like to ask how well experts, trained at the
and discuss some high-level questions about the practice task, perform. This expert performance then serves as a
and performance of neural networks. The first part of this proxy for our Bayes rate.
section presents a deep learning workflow inspired by the
bias-variance tradeoff. This workflow is especially rele- Minimize underfitting (bias) on training data
vant to industrial applications where one is often trying set.—After we have established the Bayes rate, we want
to employ neural networks to solve a particular problem. to make sure that we are using a sufficiently complex
In the second part of this section, we shift gears and ask model to avoid underfitting on the training dataset.
the question, why have neural networks been so success- In practice, this means comparing the training error
ful? We provide three different high-level explanations rate to the Bayes rate. Since the training error does
that reflect current dogmas. Finally, we end the section not care about generalization (variance), our model
by discussing the limitations of supervised learning meth- should approach the Bayes rate on the training set. If
ods and current neural network architectures. it does not, the bias of the DNN model is too large
and one should try training the model longer and/or
using a larger model. Finally, if none of these techniques
A. Organizing deep learning workflows using the bias-variance work, it is likely that the model architecture is not
tradeoff well suited to the dataset, and one should modify the
neural architecture in some way to better reflect the un-
Imagine that you are given some data and asked derlying structure of the data (symmetries, locality, etc.).
to design a neural network for learning how to per-
form a supervised learning task. What are the best Make sure you are not overfitting.— Next, we
practices for organizing a systematic workflow that run our algorithm on the validation or dev set. If the
allows us to efficiently do this? Here, we present error is similar to the training error rate and Bayes rate,
a simple deep learning workflow inspired by think- we are done. If it is not, then we are overfitting the
ing about the bias-variance tradeoff (see Figure 46). training data. Possible solutions include, regularization
This section draws heavily on Andrew Ng’s tuto- and, importantly, collecting more data. Finally, if
rial at the Deep Learning School (available online none of these work, one likely has to change the DNN
at https://www.youtube.com/watch?v=F1ka6a13S9I) architecture.
which readers are strongly encouraged to watch.
If the validation and test sets are drawn from the same
The first thing we would like to do is divide the data distributions, then good performance on the validation
into three parts. A training set, a validation or dev set should lead to similarly good performance on the
(development) set, and a test set. The test set is the test set. (Of course performance will typically be slightly
data on which we want to make predictions. The dev set worse on the test set because the hyperparameters were
is a subset of the training data we use to check how well fit to the validation set.) However, sometimes the train-
we are doing out-of-sample, after training the model on ing data and test data differ in subtle ways because, for
the training dataset. We use the validation error as a example, they are collected using slightly different meth-
61
Having discussed the basics of neural networks, we con- 2. Neural networks can exploit large amounts of data
clude by giving three complementary perspectives on the
success of DNNs and Deep Learning. This high-level dis- With the advent of smartphones and the internet, there
cussion reflects various dogmas and intuitions about the has been an explosion in the amount of data being gen-
success of DNNs and is in no way definitive or conclusive. erated. This data-rich environment favors supervised
As the reader was already warned in the introduction to learning methods that can fully exploit this rich data
DNNs, the field is rapidly expanding and many of these world. One important reason for the success of DNNs
perspectives may turn out to be only partially true or is that they are able to exploit the additional signal in
even false. Nonetheless, we include them here as a guide- large datasets for difficult supervised learning tasks. Fun-
post for readers. damentally, modern DNNs are unique in that they con-
62
• Homogeneous data.—Almost all DNNs deal A. Some of the challenges of high-dimensional data
with homogeneous data of one type. It is very hard
to design architectures that mix and match data Before we begin exploring some specific dimensional
types (i.e. some continuous variables, some discrete reduction techniques, it is useful to highlight some of the
variables, some time series). In applications beyond generic difficulties encountered when dealing with high-
images, video, and language, this is often what is dimensional data.
required. In contrast, ensemble models like random
forests or gradient-boosted trees have no difficulty
handling mixed data types. a. High-dimensional data lives near the edge of sample space.
Geometry in high-dimensional space can be counterintu-
itive. One example that is pertinent to machine learning
• Many physics problems are not about is the following. Consider data distributed uniformly at
prediction.—In physics, we are often not inter- random in a D-dimensional hypercube C = [−e/2, e/2]D ,
ested in solving prediction tasks such as classifi- where e is the edge length. Consider also a D-dimensional
cation. Instead, we want to learn something about hypersphere S of radius e/2 centered at the origin and
the underlying distribution that generates the data. contained within C. The probability that a data point x
In this case, it is often difficult to cast these ideas in drawn uniformly at random in C is contained within S
a supervised learning setting. While the problems is well approximated by the ratio of the volume of S to
are related, it’s possible to make good predictions that of C : p(kxk2 < e/2) ∼ (1/2)D . Thus, as the di-
with a “wrong” model. The model might or might mension of the feature space D increases, p goes to zero
not be useful for understanding the physics. exponentially fast. In other words, most of the data will
concentrate outside the hypersphere, in the corners of
Some of these remarks are particular to DNNs, oth- the hypercube. In physics, this basic observation under-
ers are shared by all supervised learning methods. This lies many properties of ideal gases such as the Maxwell
motivates the use of unsupervised methods which in part distribution and the equipartition theorem (see Chapter
circumnavigate these problems. 3 of (Sethna, 2006) for instance).
a) b)
2D 1D
FIG. 48 The “Swiss roll”. Data distributed in a three- FIG. 49 Illustration of the crowding problem. (Left) A two-
dimensional space (a) that can effectively be described on a dimensional dataset X consisting of 3 equidistant points.
two-dimensional surface (b). A common goal of dimensional (Right) Mapping X to a one-dimensional space while try-
reduction techniques is to preserve ordination in the data: ing to preserve relative distances leads to a collapse of the
points that are close-by in the original space are also near-by mapped data points.
in the mapped (latent) space. This is true of the mapping (a)
to (b) as can be seen by inspecting the color gradient.
B. Principal component analysis (PCA)
1
Σ(X) = X T X. (129)
N −1
Notice that the j-th diagonal entry of Σ(X) corresponds
to the variance of the j-th feature and Σ(X)ij measures
the covariance (i.e. connected correlation in the language
of physics) between feature i and feature j.
FIG. 51 (a) The first 2 principal component of the Ising We are interested in finding a new basis for the data
dataset with temperature indicated by the coloring. PCA that emphasizes highly variable directions while reducing
was performed on a joined dataset of 1000 samples taken at redundancy between basis vectors. In particular, we will
each temperatures T = 0.25, 0.5, · · · , 4.0. Almost all the vari- look for a linear transformation that reduces the covari-
ance is explained in the first component which corresponds ance between different features. To do so, we first per-
to the magnetization order parameter (linear combination of
form singular value decomposition (SVD) on the design
the features with weights all roughly equal). The paramag-
netic phase corresponds to the middle cluster and the left and matrix X, namely, X = U SV T , where S is a diagonal
right clusters correspond to the symmetry-related ferromag- matrix of singular value si , the orthogonal matrix U con-
netic phases (b) Log of the spectrum of the covariance matrix tains (as its columns) the left singular vectors of X, and
versus rank ordering. Only one dimension has high-variance. similarly V contains (as its columns) the right singular
vectors of X. With this, one can rewrite the covariance
matrix as
and the singular values of X are related to the eigenval- to the number of data points, and are thus very limited
ues of the covariance matrix Σ(X) via λi = s2i /(N − 1). in their application to large datasets. However, sample-
To reduce the dimensionality of data from p to p̃ < p, we based methods have been introduce to reduce this scaling
first construct the p× p̃ projection matrix Ṽp0 by selecting to O(N log N ) (Yang et al., 2006). In the case of PCA,
the singular components with the p̃ largest singular val- a complete decomposition has a scaling of O(N p2 + p3 ),
ues. The projection of the data from p to a p̃ dimensional where p is the number of features. Note that the first
space is simply Ỹ = X Ṽp0 . The same idea is central term N p2 is due to the computation of covariance ma-
to matrix-product-state-like techniques used to compress trix Eq.(129) while the second, p3 , stems from eigenvalue
the number of components in quantum wavefunctions in decomposition. Nothe that PCA can be improved to bear
studies of low-dimensional many-body lattice systems. complexity O(N p2 +p) if only the first few principal com-
The singular vector with the largest singular value (i.e ponents are desired (using iterative approaches). PCA
the largest variance) is referred to as the first principal and MDS are often among the first data visualization
component; the singular vector with the second largest techniques one resorts to.
singular value as the second principal component,
Pp and so
on. An important quantity is the ratio λi / i=1 λi which
is referred as the percentage of the explained variance D. t-SNE
contained in a principal component (see FIG. 51.b).
It is common in data visualization to present the data It is often desirable to preserve local structures in
projected on the first few principal components. This is high-dimensional datasets. However, when dealing with
valid as long as a large part of the variance is explained datasets having clusters delimitated by complicated sur-
in those components. Low values of explained variance faces or datasets with a large number of clusters, preserv-
may imply that the intrinsic dimensionality of the data is ing local structures becomes difficult using linear tech-
high or simply that it cannot be captured by a linear rep- niques such as PCA. Many non-linear techniques such as
resentation. For a detailed introduction to PCA, see the non-classical MDS (Cox and Cox, 2000), self-organizing
tutorials by Shlens (Shlens, 2014) and Bishop (Bishop, map (Kohonen, 1998), Isomap (Tenenbaum et al., 2000)
2006). and Locally Linear Embedding (Roweis and Saul, 2000)
have been proposed and to address this class of problems.
These techniques are generally good at preserving local
C. Multidimensional scaling structures in the data but typically fail to capture struc-
tures at the larger scale such as the clusters in which the
Multidimensional scaling (MDS) is a non-linear dimen- data is organized (Maaten and Hinton, 2008).
sional reduction technique which preserves the pairwise Recently, t-stochastic neighbor embedding (t-SNE) has
distance or dissimilarity dij between data points (Cox emerged as one of the go-to methods for visualizing high-
and Cox, 2000). Moving forward, we use the term “dis- dimensional data. It has been shown to offer insight-
tance” and “dissimilarity” interchangeably. There are two ful visualization for many benchmark high-dimensional
types of MDS: metric and non-metric. In metric MDS, datasets (Maaten and Hinton, 2008). t-SNE is a non-
the distance is computed under a pre-defined metric and parametric15 method that constructs non-linear embed-
the latent coordinates Ỹ are obtained by minimizing the dings. Each high-dimensional training point is mapped
difference between the distance measured in the original to low-dimensional embedding coordinates, which are op-
space (dij (X)) and that in the latent space (dij (Y )): timized in a way to preserve the local structure in the
X data.
Ỹ = arg min wij |dij (X) − dij (Y )|, (131) When used appropriately, t-SNE is a powerful tech-
Y
i<j nique for unraveling the hidden structure of high-
dimensional datasets while at the same time preserv-
where wij ≥ 0 are weight values. The weight matrix wij
ing locality. In physics, t-SNE has recently been used
is a set of free parameters that specify the level of confi-
to reduce the dimensionality and classify spin configu-
dence (or precision) in the value of dij (X). If Euclidean
rations, generated with the help of Monte Carlo sim-
metric is used, MDS gives the same result as PCA and is
ulations, for the Ising (Carrasquilla and Melko, 2017)
usually referred to as classical scaling (Torgerson, 1958).
and Fermi-Hubbard models at finite temperatures (Ch’ng
Thus MDS is often considered as a generalization of PCA.
et al., 2017). It was also applied to study clustering tran-
In non-metric MDS, dij can be any distance matrix. The
sitions in glass-like problems in the context of quantum
objective function is then to preserve the ordination in
the data, i.e. if d12 (X) < d13 (X) in the original space,
then in the latent space we should have d12 (Y ) < d13 (Y ).
Both MDS and PCA can be implemented using stan- 15 It does not explicitly parametrize feature extraction required to
dard Python packages such as Scikit. MDS algorithms compute the embedding coordinates. Thus it cannot be applied
typically have a scaling of O(N 3 ) where N corresponds to find the coordinate of new data points.
67
XIII. CLUSTERING
In this section, we continue our discussion of unsuper- FIG. 54 Visualization of the MNIST handwritten digits train-
vised learning methods. Unsupervised learning is con- ing dataset (here N = 60000). (a) First two principal
cerned with discovering structure in unlabeled data (for components. (b) t-SNE applied with a perplexity of 30,
a Barnes-Hut angle of 0.5 and 1000 gradient descent iter-
instance learning local structures for data visualization, ations. In order to reduce the noise and speed-up compu-
see section XII). The lack of labels make unsupervised tation, PCA was first applied to the dataset to project it
learning much more difficult and subtle than its super- down to 40 dimensions. We used an open-source implemen-
vised counterpart. What is somewhat surprising is that tation to produce the results (Linderman et al., 2017), see
even without labels it is still possible to uncover and ex- https://github.com/KlugerLab/FIt-SNE.
ploit the hidden structure in the data. Perhaps, the sim-
plest example of unsupervised learning is clustering. The
69
aim of clustering is to group unlabelled data into clusters A. Practical clustering methods
according to some similarity or distance measure. Infor-
mally, a cluster is thought of as a set of points sharing Throughout this section we focus on the Euclidean dis-
some pattern or structure. tance as a similarity measure. Other measures may be
better suited for specific problems. We refer the enthusi-
Clustering finds many applications throughout data
ast reader to (Rokach and Maimon, 2005) for a more in-
mining (Larsen and Aone, 1999), data compression and
depth discussion of the different possible similarity mea-
signal processing (Gersho and Gray, 2012; MacKay,
sures.
2003). Clustering can be used to identify coarse features
or high level structures in an unlabelled dataset. The
technique also finds many applications in physical sci-
1. K-means
ences, ranging from detecting celestial emission sources
in astronomical surveys (Sander et al., 1998) to inferring
groups of genes and proteins with similar functions in We begin our discussion with K-means clustering since
biology (Eisen et al., 1998), and building entanglement this method is simple to implement and understand, and
classifiers (Lu et al., 2017). Clustering is perhaps the covers the core concepts of clustering. Consider a set of
N
simplest way to look for hidden structure in a dataset N unlabelled observations {xn }n=1 where xn ∈ Rp and
and for this reason, is among the most widely used and where p is the number of features. Also consider a set
K
employed data analysis and machine learning techniques. of K cluster centers called the cluster means: {µk }k=1 ,
with µk ∈ R , which we’ll compute “emperically" in the
p
The field of clustering is vast and there exists a cluserting procedure. The cluster means can be thought
flurry of clustering methods suited for different purposes. of as the representatives of each cluster, to which data
Some common considerations one has to take into ac- points are assigned (see FIG. 55). K-means clustering
count when choosing a particular method is the distribu- can be formulated as follows: given a fixed integer K, find
tion of the clusters (overlapping/noisy clusters vs. well- the cluster means {µ} and the data point assignments in
separated clusters), the geometry of the data (flat vs. order to minimize the following objective function:
non-flat), the cluster size distribution (multiple sizes vs.
uniform sizes), the dimensionality of the data (low vs. K X
X N
high dimensional) and the computational efficiency of the C({x, µ}) = rnk (xn − µk )2 , (137)
desired method (small vs. large dataset). k=1 n=1
We begin section XIII.A with a focus on popular prac- where rnk ∈ {0, 1} is a binary variable called the assign-
tical clustering methods such as K-means clustering, hi- ment. The assignment rnk is 1 if xnPis assigned to cluster
erarchical clustering and density clustering. Our goal is Pand 0 otherwise. Notice that
k k rnk = 1 ∀ n and
to highlight the strength, weaknesses and differences be- r
n nk ≡ N k , where N k the number of points assigned
tween these techniques, while laying out some of the theo- to cluster k. The minimization of this objective func-
retical framework required for clustering analysis. There tion can be understood as trying to find the best cluster
exist many more clustering methods beyond those dis- means such that the variance within each cluster is min-
cussed in this section16 . The methods we discuss were imized. In physical terms, C is equivalent to the sum of
chosen for their pedagogical value and/or their applica- the moments of inertia of every cluster. Indeed, as we
bility to problems in physics. will see below, the cluster means µk correspond to the
centers of mass of their respective cluster.
In section XIII.B we discuss gaussian mixture models
and the formulation of clustering through latent variable
models. This section introduces many of the methods we
will encounter when discussing other unsupervised learn- K-means algorithm. The K-means algorithm alter-
ing methods later in the review. Finally, in section XIII.C nates between two steps:
we discuss the problem of clustering in high-dimensional
1. Expectation: Given a set of assignments {rnk },
data and possible ways to tackle this difficult problem.
minimize C with respect to µk . Taking a simple
The reader is also urged to experiment with various clus-
derivative and setting it to zero yields the follow-
tering methods using Notebook 15.
ing update rule:
1 X
µk = rnk xn . (138)
Nk n
16 Our complementary Python notebook introduces some of these 2. Maximization: Given a set of cluster means {µk },
other methods. find the assignments {rnk } which minimizes C.
70
Clearly, this is achieved by assigning each data the data set (more specifically the complexity is O(KN )
point to their nearest cluster-mean: per iteration) and is thus scalable to very large datasets.
( As we will see in section XIII.B, K-means is a hard-
1 if k = arg mink0 (xn − µk0 )2 assignment limit of the Gaussian mixture model where
rnk = (139)
0 otherwise all cluster variances are assumed to be the same. This
highlights a common drawback of K-means: if the true
K-means clustering consists in alternating between these clusters have very different variances (spreads), K-means
two steps until some convergence criterion is met. Practi- can lead to spurious results since the underlying assump-
cally, the algorithm should terminate when the change in tion is that the latent model has uniform variances.
the objective function from one iteration to another be-
comes smaller than a pre-specified threshold. A simple
2. Hierarchical clustering: Agglomerative methods
example of K-means is presented in FIG. 55.
Agglomerative clustering is a bottom up approach that
C = 10.5, t = 1 a) C = 8.8, t = 10 b) starts from small initial clusters which are then progres-
sively merged to form larger clusters. The merging pro-
cess generates a hierarchy of clusters that can be visu-
alized in the form of a dendrogram (see FIG. 56). This
hierarchy can be useful to analyze the relation between
clusters and the subcomponents of individual clusters.
Agglomerative methods are usually specified by defin-
ing a distance measure between clusters17 . We denote
the distance between clusters X and Y by d(X, Y ) ∈ R.
Different choices of distance result in different clustering
d)
C = 8.0, t = 20 c) 10.5 algorithms. At each step, the two clusters that are the
10.0 closest with respect to the distance measure are merged
until a single cluster is left.
9.5
9.0
Agglomerative clustering algorithm Agglomerative
8.5 clustering algorithms can thus be summarized as follows:
8.0
C
1. Initialize each point to its own cluster.
0 10 20
t 2. Given a set of K clusters X1 , X2 , · · · , XK , merge
clusters until one cluster is left (K = 1):
FIG. 55 K-means with K = 3 applied to an artificial two-
dimensional dataset. The cluster means at each iteration are (a) Find the closest pair of clusters (Xi , Xj ):
indicated by cyan star markers. t indicates the iteration num- (i, j) = arg min(i0 ,j 0 ) d(Xi0 , Xj 0 )
ber and C the value of the objective function. (a) The algo-
(b) Merge the pair. Update: K ← K − 1
rithm is initialized by randomly partitioning the space into 3
sectors to generate an initial assignment. (b)-(c) For well sep- Here we list a few of the most popular distances used
arated clusters, the algorithm converges rapidly to the true in agglomerative methods, often called linkage methods
clusters. (d) The objective function as a function of the it-
eration. C converges after t = 18 iterations for this choice of
in the clustering literature.
random seed (for center initialization). 1. Single-linkage: the distance between clusters i and
j is defined as the minimum distance between two
A nice property of the K-means algorithm is that it elements of the different clusters
is guaranteed to converge. To see this, one can verify
d(Xi , Xj ) = min ||xi − xj ||2 . (140)
explicitly (by taking second-order derivatives) that the xi ∈Xi ,xj ∈Xj
expectation step always decreases C. This is also true for
the assignment step. Thus, since C is bounded from be- 2. Complete linkage: the distance between clusters i
low, the two-step iteration of K-means always converges and j is defined as the maximum distance between
to a local minimum of C. Since C is generally a non- two elements of the different clusters.
convex function, in practice one usually needs to run the d(Xi , Xj ) = max ||xi − xj ||2 (141)
algorithm with different initial random cluster center ini- xi ∈Xi ,xj ∈Xj
d(X, Y )
tional complexity of O(N 2 ) (Müllner, 2011), making the
method suitable for small to medium-size datasets. A 0.15
simple but major speed-up for the method is to initial-
0.10
ize the clusters with K-means using a large K (but still
a small fraction of N ) and then proceed with hierarchi-
0.05
cal clustering. This has the advantage of preserving the
large-scale structure of the hierarchy while making use of
0.00
the linear scaling of K-means. In this way, hierarchical 0 1 4 5 2 3
clustering may be applied to very large datasets. Leaf label
FIG. 56 Hierarchical clustering example with single linkage.
(a) The data points are successively grouped as denoted by the
3. Density-based (DB) clustering colored dotted lines. (b) Dendrogram representation of the
hierarchical decomposition. Each node of the tree represents
Density clustering makes the intuitive assumption that a cluster. One has to specify a scale cut-off for the distance
clusters are defined by regions of space with higher den- measure d(X, Y ) (corresponding to a horizontal cut in the
sity of data points. Data points that constitute noise or dendrogram) in order to obtain a set of clusters.
that are outliers are expected to form regions of low den-
sity. Density clustering has the advantage of being able to
DBSCAN algorithm. Here we describe the most
consider clusters of multiple shapes and sizes while identi-
prominent DB clustering algorithm: DBSCAN, or
fying outliers. The method is also suitable for large-scale
density-based spatial clustering of applications with noise
applications.
(Ester et al., 1996). Consider once again a set of N data
The core assumption of DB clustering is that a rel- N
ative local density estimation of the data is possible. points X ≡ {xn }n=1 .
In other words, it is possible to order points according We start by defining the ε-neighborhood of point xn
to their densities. Density estimates are usually accu- as follows:
rate for low-dimensional data but become unreliable for Nε (xn ) = {x ∈ X|d(x, xn ) < ε} . (144)
high-dimensional data due to large sampling noise. Here,
for brevity, we confine our discussion to one of the most Nε (xn ) are the data points that are at a distance smaller
widely used density clustering algorithms, DBSCAN. We than ε from xn . As before, we consider d(·, ·) to be the
have also had great success with another recently in- Euclidean metric (which yields spherical neighborhoods,
troduced variant of DB clustering (Rodriguez and Laio, see Figure 57) but other metrics may be better suited
2014) that is similar in spirit which the reader is urged depending on the specific data. Nε (xn ) can be seen as a
to consult. One of the authors (A. D.) has also created crude estimate of local density. xn is considered to be a
a Python package, https://pypi.org/project/fdc/, core-point if at least minPts are in its ε-neighborhood.
which makes use of accurate density estimates via ker- minPts is a free parameter of the algorithm that sets
nel methods combined with agglomerative clustering to the scale of the size of the smallest cluster one should
produce fast and accurate density clustering (see also expect. Finally, a point xi is said to be density-reachable
GitHub repository). if it is in the ε-neighborhood of a core-point. From these
72
Relative density
since efficient implementations have a computational cost
of O(N log N ).
served dataset under our generative model). Such MLE GMM parameters as
equations often give rise to the kind of Expectation Maxi-
mization (EM) equations that we first encountered in the p(x, z; θ) = p(x|z; {µk , Σk })p(z|{πk }). (150)
last section in the context of K-means clustering. We can also use Bayes rule to rearrange this expression
Gaussian Mixtures models (GMM) are a generative to give the conditional probability of the data point x
model often used in the context of clustering. In GMM, being in the k-th cluster, γ(zk ), given model parameters
points are drawn from one of K Gaussians, each with its θ as
own mean µk and covariance matrix Σk ,
πk N (x|µk , Σk )
(151)
1 γ(zk ) ≡ p(zk = 1|x; θ) = PK .
N (x|µ, Σ) ∼ exp − (x − µ)Σ (x − µ) . (145)
−1 T
2 j=1 πj N (x|µj , Σj )
Let us denote the probability that a point is drawn from The γ(zk ) are often referred to as the “responsibility”
mixture k by πk . Then, the probability of generating a that mixture k takes for explaining x. Just like in our
point x in a GMM is given by discussion of soft-max classifiers, this can be made into
K
a “hard-assignment” by assigning each point to the clus-
ter with the largest probability: arg maxk γ(zk ) over the
X
p(x|{µk , Σk , πk }) = N (x|µk , Σk )πk . (146)
k=1
responsibilities.
The complication is of course that we do not know
Given a dataset X = {x1 , · · · , xN }, we can write the the parameters θ of the underlying GMM but instead
likelihood of the dataset as must also learn them from the dataset X. As discussed
N above, ideally we could do this by choosing the param-
eters that maximize the likelihood (or equivalently the
Y
p(X|{µk , Σk , πk }) = p(xi |{µk , Σk , πk }) (147)
i=1 log-likelihood) of the data
N X
K
(t)
X
Ep̃(t) [log p(X, Z; θ)] = γik [log N (xi |µk , Σk ) + log πk ] , (153)
i=1 k=1
(t)
where we have used the shorthand γik = p(zik |X; θ(t) )
with zik the k-th component of zi . Taking the derivative
of this equation with
P respect to µk , Σk , and πk (subject
to the constraint k πk = 1) and setting this to zero
yields the intuitive equations
PN (t)
(t+1) i γik xi
µk = P (t)
i γik
PN (t)
(t+1) γik (xi − µk )(xi − µk )T
i
Σk = P (t)
i γik
(t+1) 1 X (t)
πk = γik (154)
N
k
These are just the usual estimates for the mean and vari-
ance, with each data point weighed according to our cur-
rent best guess for the probability that it belongs to clus-
ter k. We can then use our new estimate θ(t+1) to calcu-
(t+1)
late responsibility γik and repeat the process. This is
essentially the K-Means algorithm discussed in the first
section.
This discussion of the Gaussian mixture model intro-
duces several concepts that we will return to repeatedly
in the context of unsupervised learning. First, it is often
useful to think of the visible correlations between features
in the data as resulting from hidden or latent variables.
Second, we will often posit a generative model that en-
codes the structure we think exists in the data and then
find parameters that maximize the likelihood of the ob-
served data. Third, often we will not be able to directly FIG. 58 (a) Application of gaussian mixture modelling to
estimate the MLE, and will have to instead look for a the Ising dataset. The normalized histogram corresponds to
computationally efficient way to find a local minimum of the first principal component distribution of the dataset (or
the likelihood. equivalently the magnetization in this case). The 1D data
is fitted with a K = 3-component gaussian mixture. The
likehood of the fitted gaussian mixture is represented in red
C. Clustering in high dimensions and is obtained via the expectation-maximization algorithm
(b) The gaussian mixture model can be used to compute
Clustering data in high-dimension can be very chal- posterior probability (responsibilities), i.e. the probability
of being in one of the phases. Note that the point where
lenging. One major problem that is aggravated in high- γ(1) = γ(2) = γ(3) can be interpreted as the critical point.
dimensions is the generic accumulation of noise due to Indeed the crossing occurs at T ≈ 2.26.
random measurement error for each feature. This in turn
leads to increased errors for pairwise similarity and dis-
tance measures and thus tends to “blur” distances be-
tween data points (Domingos, 2012; Kriegel et al., 2009; ceeding with using a standard clustering method such as
Zimek et al., 2012). Many clustering algorithms rely on K-means (Kriegel et al., 2009). Figure 54 illustrates an
the explicit use of a similarity measure or distance met- application of denoising to high-dimensional data. PCA
rics that weigh all features equally. For this reason, one (section XII.B) was used to denoise the MNIST dataset
must be careful when using an off-the-shelf method in by projecting the 784 original dimensions onto the 40 di-
high dimensions. mensions with the largest principal components. The re-
In order to perform clustering on high-dimensional sulting features were then used to construct a Euclidean
data, it is often useful to denoise the data before pro- distance matrix which was used by t-SNE to compute
75
the two-dimensional embedding that is presented. Using plicated probability distributions, it is often much easier
t-SNE directly on original data leads to a “blurring” of to learn the relative weights of different states or data
the clusters (the reader is encouraged to test this them- points (ratio of probabilities), than absolute probabili-
selves). ties. In physics, this is the familiar statement that the
However, simple feature selection or feature denoising weights of a Boltzmann distribution are much easier to
(using PCA for instance) can sometimes be insufficient calculate than the partition function. The relative prob-
for learning clusters due to the presence of large vari- ability of two configurations, x1 and x2 , are proportional
ations in the signal and noise of the features that are to the difference between their Boltzmann weights
relevant for identifying the underlying clusters (Kriegel p(x1 )
et al., 2009). Recent promising work suggests that one = e−β(E(x1 )−E(x2 )) , (155)
p(x2 )
way to overcome these limitations is to learn the latent
space and the cluster labels at the same time (Xie et al., where as is usual in statistical mechanics β is the inverse
2016). temperature and E(x; θ) is the energy of state x given
Finally we end the clustering section with a short dis- some parameters (couplings) θ . However, calculating the
cussion on clustering validation, which can be particu- absolute weight of a configuration requires knowledge of
larly difficult for high-dimensional data. Often clustering the partition function
validation, i.e. verifying whether the obtained labels are Zp = Trx e−βE(x) , (156)
“valid” is done by direct visual inspection. That is, the
data is represented in a low-dimensional space and the (where the trace is taken over all possible configurations
cluster labels obtained are visually inspected to make x) since
sure that different labels organize into distinct “blobs”.
e−βE(x)
For high-dimensional data, this is done by performing p(x) = . (157)
dimensional reduction (section XII). However, this can Zp
lead to the appearance of spurious clusters since dimen- In general, calculating the partition function Zp is ana-
sional reduction inevitably loses information about the lytically and computationally intractable.
original data. Thus, these methods should be used with For example, for the Ising model with N binary spins,
care when trying to validate clusters [see (Wattenberg the trace involves calculating a sum over 2N terms, which
et al., 2016) for an interactive discussion on how t-SNE is a difficult task for most energy functions. For this rea-
can sometime be misleading and how to effectively use son, physicists (and machine learning scientists) have de-
it]. veloped various numerical and computational methods
A lot of work has been done to devise ways of validating for evaluating such partition functions. One approach
clusters based on various metrics and measures (Kriegel is to use Monte-Carlo based methods to draw samples
et al., 2009). Perhaps one of the most intuitive way of from the underlying distribution (this can be done know-
defining a good clustering is by measuring how well clus- ing only the relative probabilities) and then use these
ters generalize. Clustering methods based on leveraging samples to numerically estimate the partition function.
powerful classifiers to measure the generalization errors This is the philosophy behind powerful methods such as
of the clusters have been developed by some of the au- Markov Chain Monte Carlo (MCMC) (Andrieu et al.,
thors (Day and Mehta, 2018), see https://pypi.org/ 2003) and annealed importance sampling (Neal and Hin-
project/hal-x/. We believe this represents an espe- ton, 1998) which are widely used in both the statistical
cially promising research direction in high-dimensional physics and machine learning communities. An alterna-
clustering. Finally, we emphasize that this discussion is tive approach – which we focus on here – is to approxi-
far from exhaustive and we refer the reader to (Rokach mate the the probability distribution p(x) and partition
and Maimon, 2005), Chapter 15, for an in-depth survey function using a “variational distribution” q(x; θq ) whose
of the various validation techniques. partition function we can calculate exactly. The varia-
tional parameters θq are chosen to make the variational
distribution as close to the true distribution as possible
XIV. VARIATIONAL METHODS AND MEAN-FIELD (how this is done is the focus of much of this section).
THEORY (MFT) One of the most-widely applied examples of a varia-
tional method in statistical physics is Mean-Field Theory
A common thread in many unsupervised learning tasks (MFT). MFT can be naturally understood as a procedure
is accurately representing the underlying probability dis- for approximating the true distribution of the system by
tribution from which a dataset is drawn. Unsuper- a factorized distribution. The deep connection between
vised learning of high-dimensional, complex distributions MFT and variational methods is discussed below. These
presents a new set of technical and computational chal- variational MFT methods have been extended to under-
lenges that are different from those we encountered in stand more complicated spin models (also called graph-
a supervised learning setting. When dealing with com- ical models in the ML literature) and form the basis of
76
powerful set of techniques that go under the name of Be- with {si =±1} denoting the sum over all possible con-
P
lief Propagation and Survey Propagation (MacKay, 2003; figurations of the spin variables. We write Zp to em-
Wainwright et al., 2008; Yedidia et al., 2003). phasize that this is the partition function corresponding
Variational methods are also widely used in ML to ap- to the probability distribution p(s|β, J ), which will be-
proximate complex probabilistic models. For example, come important later. For a fixed number of lattice sites
below we show how the Expectation Maximization (EM) N , there are 2N possible configurations, a number that
procedure, which we discussed in the context of Gaus- grows exponentially with the system size. Therefore, it
sian Mixture Models for clustering, is actually a general is not in general feasible to evaluate the partition func-
method that can be derived for any latent (hidden) vari- tion Zp (β, J ) in closed form. This represents a major
able model using a variational procedure (Neal and Hin- practical obstacle for extracting predictions from physi-
ton, 1998). This section serves as an introduction to this cal theories since the partition function is directly related
powerful class of variational techniques. For readers in- to the free-energy through the expression
terested in an in-depth discussion on variational infer-
ence for probabilistic graphical models, we recommend βFp (J ) = − log Zp (β, J ) = βhE(s, J )ip − Hp ,(160)
the great treatise written by Michael I. Jordan and oth- with
ers(Jordan et al., 1999), the more physics oriented dis-
cussion in (Yedidia, 2001; Yedidia et al., 2003), as well as
X
Hp = − p(s|β, J ) log p(s|β, J ) (161)
David MacKay’s outstanding book (MacKay, 2003). {si =±1}
between the spins. For instance, it predicts the wrong parameter θ (t) to be those with maximum likeli-
value for the critical temperature for the two-dimensional hood, assuming qt−1 (z) found in the previous step
Ising model. It even erroneously predicts the existence of is the true distribution of hidden variable z:
a phase transition in one dimension at a non-zero tem-
θt = arg maxhlog p(z, x|θ)iqt−1 (173)
perature. We refer the interested reader to standard θ
textbooks on statistical physics for a detailed analysis
of applicability of MFT to the Ising model. However, It was shown (Dempster et al., 1977) that each EM iter-
we emphasize that the failure of any particular varia- ation increases the true log-likelihood L(θ), or at worst
tional ansatz does not compromise the usefulness of the leaves it unchanged. In most models, this iteration pro-
approach. In some cases, one can consider changing the cedure converges to a local maximum of L(θ).
variational ansatz to improve the predictive properties
of the corresponding variational MFT (Yedidia, 2001;
Yedidia et al., 2003). The take-home message is that
variational MFT is a powerful tool but one that must be θ ( t +2)
applied and interpreted with care.
M-step
would like to minimize (see Table I). Note that we have 2. Maximization step: Fix q, update the variational
chosen to employ a physics sign convention here of defin- parameters:
ing the free-energy as minus log of the partition function.
In the ML literature, this minus sign is often omitted θ (t) = arg max −Fqt−1 (θ). (178)
θ
(Neal and Hinton, 1998) and this can lead to some con-
fusion. Our goal is to choose θ so that our variational To recapitulate, EM implements ML estimation even
free-energy Fq (θ) is as close to the true free-energy Fp (θ) with missing or hidden variables through optimizing a
as possible. The difference between these free-energies lower bound of the true log-likelihood. In statistical
can be written as physics, this is reminiscent of optimizing a variational
free-energy which is a lower bound of true free-energy
Fq (θ) − Fp (θ) = hfq (x, θ) − fp (x, θ)iPx , (176)
due to Gibbs inequality. In Fig. 59, we show pictorially
where how EM works. The E-step can be seen as representing
the unobserved variable z by a probability distribution
fq (x, θ) − fp (x, θ)
X q(z). This probability is used to construct an alterna-
= log p(x|θ) − q(z|x) log p(z, x|θ) tive objective function −Fq (θ), which is then maximized
z with respect to θ in the M-step. By construction, maxi-
mizing the negative variational free-energy is equivalent
X
+ q(z|x) log q(z|x)
z to doing ML estimation on the joint data (i.e. both ob-
X X served and unobserved). The name “M-step” is intuitive
= q(z|x) log p(x|θ) − q(z|x) log p(z, x|θ)
since the parameters θ are found by maximizing −Fq (θ).
z z
X The name “E-step” comes from the fact that one usually
+ q(z|x) log q(z|x) doesn’t need to construct the probability of missing datas
z
explicitly, but rather need only compute the “expected"
X p(z, x|θ) X sufficient statistics over these data, cf. Fig. 59.
=− q(z|x) log + q(z|x) log p̃(z)
z
p(x|θ) z On the practical side, EM has been demonstrated to be
X q(z|x) extremely useful in parameter estimation, particularly in
= q(z|x) log hidden Markov models and Bayesian networks (see, for
p(z|x, θ)
z example, (Barber, 2012; Wainwright et al., 2008)). Some
= DKL (q(z|x)kp(z|x, θ)) ≥ 0 of the authors have used EM in biophysics, to design al-
where we have used Bayes’ theorem p(z|x, θ) = gorithms which establish the equivalence of niche theory
p(z, x|θ)/p(x|θ). Since the KL-divergence is always pos- and the Minimum Environmental Perturbation Princi-
itive, this shows that the variational free-energy Fq is ple (Marsland III et al., 2019). One of the striking ad-
always an upper bound of the true free-energy Fp . In vantages of EM is that it is conceptually simple and easy
physics, this result is known as Gibbs’ inequality. to implement (see Notebook 16). In many cases, imple-
From Eq. (174) and the fact that the the entropy term mentation of EM is guaranteed to increase the likelihood
in Eq. (174) does not depend on θ, we can immediately monotonically, which could be a perk during debugging.
see that the maximization step (M-step) in Eq. (173) For readers interested in an overview on applications of
is equivalent to minimizing the variational free-energy EM, we recommend (Do and Batzoglou, 2008).
Fq (θ). Surprisingly, the expectation step (E-step) can Finally for advanced readers familiar with the physics
also viewed as the optimization of this variational free- of disordered systems, we note that it is possible to
energy. Concretely, one can show that the distribution construct a one-to-one dictionary between EM for la-
of hidden variables z given the observed variable x and tent variable models and the MFT of spin systems with
the current estimate of parameter θ, Eq. (172), is the quenched disorder. In a disordered spin systems, the
unique probability q(z) that minimizes Fq (θ) (now seen Ising couplings J are commonly taken to be quenched
as a functional of q). This can be proved by taking the random variables drawn from some underlying probabil-
functional derivative P of Eq. (174), plus a Lagrange mul- ity distribution. In the EM procedure, the quenched dis-
tiplier that encodes z q(z) = 1, with respect to q(z). order is provided by the observed data points x which
Summing things up, we can re-write EM in the following are drawn from some underlying probability distribution
form (Neal and Hinton, 1998): that characterizes the data. The spins s are like the hid-
den or latent variables z. Similar analogues can be found
1. Expectation step: Construct the approximating for all the variational MFT quantities (see Table I). This
probability distribution of unobserved z given the striking correspondence offers a glimpse into the deep
values of observed variable x and parameter esti- connection between statistical mechanics and unsuper-
mate θ (t−1) : vised latent variable models – a connection that we will
repeatedly exploit to gain more intuition for the energy-
qt−1 (z) = arg min Fq (θ (t−1) ) (177)
q based unsupervised models considered in the next few
80
statistical physics Variational EM section starts with a brief overview of generative mod-
spins/d.o.f.: s hidden/latent variables z els, highlighting the similarities and differences with the
couplings /quenched disorder: data observations: x supervised learning methods encountered in earlier sec-
J tions. Next, we introduce perhaps the simplest kind of
Boltzmann factor e−βE(s,J) Complete probability: generative models – Maximum Entropy (MaxEnt) mod-
p(x, z|θ) els. MaxEnt models have no latent (or hidden) vari-
partition function: Z(J ) marginal likelihood p(x|θ) ables, making them ideal for introducing the key concepts
energy: βE(s, J ) negative log-complete data and tools that underlie energy-based generative models.
likelihood: − log p(x, z|θ, m) We then present an extended discussion of how to train
free energy: βFp (J |β) negative log-marginal likeli- energy-based models. Much of this discussion will also
hood: − log p(x|m) be applicable to more complicated energy-based models
variational distribution: q(s) variational distribution: such as Restricted Boltzmann Machines (RBMs) and the
q(z|x) deep models discussed in the next section.
variational free-energy: variational free-energy: Fq (θ)
Fq (J , θ)
A. An overview of energy-based generative models
TABLE I Analogy between quantities in statistical physics
and variational EM. Generative models are a machine learning technique
that allows to learn how to generate new examples sim-
ilar to those found in a training dataset. The core idea
chapters. of most generative models is to learn a parametric model
for the probability distribution from which the data was
drawn. Once we have learned a model, we can gener-
XV. ENERGY BASED MODELS: MAXIMUM ENTROPY ate new examples by sampling from the learned gen-
(MAXENT) PRINCIPLE, GENERATIVE MODELS, AND
BOLTZMANN LEARNING
erative model (see Fig. 60). As in statistical physics,
this sampling is often done using Markov Chain Monte
Most of the models discussed in the previous sections Carlo (MCMC) methods. A review of MCMC methods
(e.g. linear and logistic regression, ensemble models, and is beyond the scope of this discussion: for a concise and
supervised neural networks) are discriminative – they beautiful introduction to MCMC-inspired methods that
are designed to perceive differences between groups or bridges both statistical physics and ML the reader is en-
categories of data. For example, recognizing differences couraged to consult Chapters 29-32 of David MacKay’s
between images of cats and images of dogs allows a dis- book (MacKay, 2003) as well as the review by Michael
criminative model to label an image as “cat” or “dog”. I. Jordan and collaborators (Andrieu et al., 2003).
Discriminative models form the core techniques of most The added complexity of learning models directly
supervised learning methods. However, discriminative from samples introduces many of the same fundamental
methods have several limitations. First, like all super- tensions we encountered when discussing discriminative
vised learning methods, they require labeled data. Sec- models. The ability to generate new examples requires
ond, there are tasks that discriminative approaches sim- models to be able to “generalize” beyond the examples
ply cannot accomplish, such as drawing new examples they have been trained on, that is to generate new sam-
from an unknown probability distribution. A model that ples that are not samples of the training set. The models
can learn to represent and sample from a probability dis- must be expressive enough to capture the complex cor-
tribution is called generative. For example, a genera- relations present in the underlying data distribution, but
tive model for images would learn to draw new examples the amount of data we have is finite which can give rise
of cats and dogs given a dataset of images of cats and to overfitting.
dogs. Similarly, given samples generated from one phase In practice, most generative models that are used in
of an Ising model we may want to generate new sam- machine learning are flexible enough that, with a suffi-
ples from that phase. Such tasks are clearly beyond the cient number of parameters, they can approximate any
scope of discriminative models like the ensemble models probability distribution. For this reason, there are three
and DNNs discussed so far in the review. Instead, we axes on which we can differentiate classes of generative
must turn to a new class of machine learning methods. models:
The goal of this section is to introduce the reader to • The first axis is how easy the model is to train –
energy-based generative models. As we will see, energy- both in terms of computational time and the com-
based models are closely related to the kinds of models plexity of writing code for the algorithm.
commonly encountered in statistical physics. We will
draw upon many techniques that have their origin in • The second axis is how well the model generalizes
statistical mechanics (e.g. Monte-Carlo methods). The from the training set to the test set.
81
close connection between statistical physics and machine The general form of the maximum entropy distribution
learning). Jaynes showed that the Boltzmann distribu- is then given by
tion could be viewed as resulting from a statistical in-
1 Pi λi fi (x)
ference procedure for learning probability distributions p(x) = e (181)
describing physical systems where one only has partial Z
information about the system (usually the average en- where Z(λi ) = dx e i λi fi (x) is the partition function.
R P
and ML is that in ML we have no direct access to ob- consider two special cases where x has different support
served values hfi iobs . Instead, these averages must be (different kinds of data). First, consider the case that the
directly estimated from data (samples). To denote this random variables x ∈ Rn are real numbers. In this case
difference, we will call empirical averages calculated from we can compute the partition function directly:
data as hfi idata . We can think of MaxEnt as a statisti- Z
cal inference procedure simply by replacing hfi iobs by T 1 T 1 T −1
Z = dx ea x+ 2 x Jx = (2π)n detJ −1 e− 2 a J a .
p
hfi idata above.
This subtle change has important implications for (187)
training MaxEnt models. First, since we do not know
these averages exactly, but must estimate them from the The resulting probability density function is,
data, our training procedures must be careful not to over-
p(x) = Z −1 e−E(x)
fit to the observations (our samples might not be reflec-
tive of the true values of these statistics). Second, the av- 1 1 T −1 T 1 T
=p e 2 a J a+a x+ 2 x Jx
erages of certain functions fi are easier to estimate from (2π) detJ
n −1
sideration when formulating which MaxEnt model to fit =p e− 2 (x−µ) Σ (x−µ) , (188)
(2π) detΣ
n
to the data. Finally, we note that unlike in physics where
conservation laws often suggest the functions fi whose where µ = −J −1 a and Σ = −J −1 . This, of course, is the
averages we hold fix, ML offers no comparable guide for normalized, multi-dimensional Gaussian distribution.
how to choose the fi we care about. For these reasons, Second, consider the case that the random variable x
choosing the {fi } is often far from straightforward. As a is binary with xi ∈ {−1, +1}. The energy function takes
final point, we note that here we have presented a physics- the same form as Eq. (186), but the partition function
based perspective for justifying the MaxEnt procedure. can no longer be computed in a closed form. This model
We mention in passing that the MaxEnt in ML is also is known as the Ising model in the physics literature, and
closely related to ideas from Bayesian inference (Jaynes, is often called a Markov Random Field in the machine
1968, 2003) and this latter point of view is more com- learning literature. It is well known to physicists that
mon in discussions of MaxEnt in the statistics and ML calculating the partition function for the Ising Model is
literature. intractable. For this reason, the best we can do is esti-
mate it using numerical techniques such MCMC methods
or approximate methods like variational MFT methods,
3. Generalized Ising Models from MaxEnt
see Sec. XIV. Finally, we note that in ML it is common to
use binary variables which take on values in xi ∈ {0, 1}
The form of a MaxEnt model is completely specified
rather than {±1}. This can sometimes be a source of con-
once we choose the averages {fi } we wish to constrain.
fusion when translating between ML and physics litera-
One common choice often used in MaxEnt modeling is to
tures and can lead to confusion when using ML packages
constrain the first two moments of a distribution. When
for physics problems.
our random variables x are continuous, the corresponding
MaxEnt distribution is a multi-dimensional Gaussian. If
the x are binary (discrete), then the corresponding Max-
C. Cost functions for training energy-based models
Ent distribution is a generalized Ising (Potts) model with
all-to-all couplings.
The MaxEnt procedure gives us a way of parametrizing
To see this, consider a random variable x with first
an energy-based generative model. For any energy-based
and second moments hxi idata and hxi xj idata , respectively.
generative model, the energy function E(x, {θi }) depends
According to the Principle of Maximum Entropy, we
on some parameters θi – couplings in the language of
should choose to model this variable using a Boltzmann
statistical physics – that must be inferred directly from
distribution with constraints on the first and second mo-
the data. For example, for the MaxEnt models the {θi }
ments. Let ai be the Lagrange multiplier associated with
are just the Lagrange multipliers {λi } introduced in the
hxi idata and Jij /2 be the Lagrange multiplier associated
last section. The goal of the training procedure is to use
with hxi xj idata . Using Eq. (182), it is easy to verify that
the available training data to fit these parameters.
the energy function
Like in many other ML techniques, we will fit these
X 1X couplings by minimizing a cost function using stochastic
E(x) = − a i xi − Jij xi xj (186)
2 ij gradient descent (cf. Sec. IV). Such a procedure naturally
i
separates into two parts: choosing an appropriate cost
satisfies the above constraints. function, and calculating the gradient of the cost func-
Partition functions for maximum entropy models are tion with respect to the model parameters. Formulating
often intractable to compute. Therefore, it is helpful to a cost function for generative models is a little bit trickier
84
than for supervised, discriminative models. The objec- ing the log-likelihood:
tive of discriminative models is straightforward – predict
the label from the features. However, what we mean by L({θi }) = hlog (pθ (x))idata
a “good” generative model is much harder to define using = −hE(x; {θi })idata − log Z({θi }), (189)
a cost function. We would like the model to generate
where we have set β = 1. In writing this expression we
examples similar to those we find in the training dataset.
made use of two facts: (i) our generative distribution is
However, we would also like the model to be able to gen-
of the Boltzmann form, and (ii) the partition function
eralize – we do not want the model to reproduce “spurious
does not depend on the data:
details” that are particular to the training dataset. Un-
like for discriminative models, there is no straightforward hlog Z({θi })idata = log Z({θi }). (190)
idea like cross-validation on the data labels that neatly
addresses this issue. For this reason, formulating cost
functions for generative models is subtle and represents 2. Regularization
an important and interesting open area of research.
Calculating the gradients of energy-based models also Just as for discriminative models like linear and logistic
turns out to be different than for discriminative mod- regression, it is common to supplement the log-likelihood
els, such as deep neural networks. Rather than relying with additional regularization terms (see Secs. VI and
on automatic differentiation techniques and backpropa- VII). Instead of minimizing the negative log-likelihood,
gation (see Sec. IX.C), calculating the gradient requires one minimizes a cost function of the form
drawing on intuitions from MCMC-based methods. Be-
low, we provide an in-depth discussion of Boltzmann − L({θi }) + Ereg ({θi }), (191)
learning for energy-based generative models, focusing on where Ereg ({θi }) is an additional regularization term that
MaxEnt models. We put the emphasis on training pro- prevents overfitting. From a Bayesian perspective, this
cedures that generalize to more complicated generative new term can be viewed as encoding a (negative) log-
models with latent variables such as RBMs discussed in prior on model parameters and performing a maximum-
the next section. Therefore, we largely ignore the in- a-posteriori (MAP) estimate instead of a MLE (see cor-
credibly rich physics-based literature on fitting Ising-like responding discussion in Sec. VI).
MaxEnt models (see the recent reviews (Baldassi et al., As we saw by studying linear regression, different forms
2018; Nguyen et al., 2017) and references therein). of regularization give rise to different kinds of properties.
A common choice for the regularization function are the
sums of the L1 or L2 norms of the parameters
X
1. Maximum likelihood Ereg ({θi }) = Λ |θi |α , α = 1, 2 (192)
i
By far the most common approach used for training a with Λ controlling the regularization strength. For Λ = 0,
generative model is to maximize the log-likelihood of the there is no regularization and we are simply performing
training data set. Recall, that the log-likelihood char- MLE. In contrast, a choice of large Λ will force many
acterizes the log-probability of generating the observed parameters to be close to or exactly zero. Just as in
data using our generative model. By choosing the nega- regression, an L1 penalty enforces sparsity, with many of
tive log-likelihood as the cost function, the learning pro- the θi set to zero, and L2 regularization shrinks the size
cedure tries to find parameters that maximize the proba- of the parameters towards zero.
bility of the data. This cost function is intuitive and has One challenge of generative models is that it is often
been the work-horse of most generative modeling. How- difficult to choose the regularization strength Λ. Recall
ever, we note that the Maximum Likelihood estimation that, for linear and logistic regression, Λ is chosen to
(MLE) procedure has some important limitations that maximize the out-of-sample performance on a validation
we will return to in Sec. XVII. dataset (i.e. cross-validation). However, for generative
In what follows, we employ a general notation that is models our data are usually unlabeled. Therefore, choos-
applicable to all energy-based models, not just the Max- ing a regularization strength is more subtle and there ex-
Ent models introduced above. The reason for this is that ists no universal procedure for choosing Λ. One common
much of this discussion does not rely on the specific form strategy is to divide the data into a training set and a val-
of the energy function but only on the fact that our gen- idation set and monitor a summary statistic such as the
erative model takes a Boltzmann form. We denote the log-likelihood, energy distance (Székely, 2003), or varia-
generative model by the probability distribution pθ (x) tional free-energy of the generative model on the training
and its corresponding partition function by log Z({θi }). and validation sets (the variational free-energy was dis-
In MLE, the parameters of the model are fit by maximiz- cussed extensively in Sec. XIV ) (Hinton, 2012). If the
85
gap between the training and validation datasets starts To use SGD, we must still calculate the expectation
growing, one is probably overfitting the model even if values that appear in Eq. (195). The positive phase of the
the log-likelihood of the training dataset is still increas- gradient – the expectation values with respect to the data
ing. This also gives a procedure for “early stopping” – – can be easily calculated using samples from the training
a regularization procedure we introduced in the context dataset. However, the negative phase – the expectation
of discriminative models. In practice, when using such values with respect to the model – is generally much more
regularizers it is important to try many different values difficult to compute. We will see that in almost all cases,
of Λ and then try to use a proxy statistic for overfitting we will have to resort to either numerical or approximate
to evaluate the optimal choice of Λ. methods. The fundamental reason for this is that it is
impossible to calculate the partition function exactly for
most interesting models in both physics and ML.
D. Computing gradients
There are exceptional cases in which we can calcu-
We still need to specify a procedure for minimizing the late expectation values analytically. When this hap-
cost function. One powerful and common choice that pens, the generative model is said to have a Tractable
is widely employed when training energy-based models Likelihood. One example of a generative model with a
is stochastic gradient descent (SGD) (see Sec. IV). Per- Tractable Likelihood is the Gaussian MaxEnt model for
forming MLE using SGD requires calculating the gradi- real valued data discussed in Eq. (188). The param-
ent of the log-likelihood Eq. (189) with respect to the eters/Lagrange multipliers for this model are the local
parameters θi . To simplify notation and gain intuition, fields a and the pairwise coupling matrix J. In this case,
it is helpful to define “operators” Oi (x), conjugate to the the usual manipulations involving Gaussian integrals al-
parameters θi low us to exactly find the parameters µ = −J −1 a and
Σ = −J −1 , yielding the familiar expressions µ = hxidata
∂E(x; θi ) and Σ = h(x − hxidata )(x − hxidata )T idata . These are
Oi (x) = . (193)
∂θi the standard estimates for the sample mean and covari-
ance matrix. Converting back to the Lagrange multipli-
Since the partition function is just the cumulant gener-
ers yields
ating function for the Boltzmann distribution, we know
that the usual statistical mechanics relationships between
expectation values and derivatives of the log-partition J = −h(x − hxidata )(x − hxidata )T i−1 (196)
data .
function hold:
∂ log Z({θi })
hOi (x)imodel = Trx pθ (x)Oi (x) = − . (194) Returning to the generic case where most energy-based
∂θi
models have intractable likelihoods, we must estimate ex-
In terms of the operators {Oi (x)}, the gradient of pectation values numerically. One way to do this is draw
Eq. (189) takes the form (Ackley et al., 1987) samples Smodel = {x0i } from the model pθ (x) and evalu-
∂L({θi }) D ∂E(x; θi ) E ∂ log Z({θi }) ate arbitrary expectation values using these samples:
− = +
∂θi ∂θi data ∂θi
(195)
Z
= hOi (x)idata − hOi (x)imodel . X
hf (x)imodel = dxpθ (x)f (x) ≈ f (x0i ). (197)
These equations have a simple and beautiful interpre- x0i ∈Smodel
tation. The gradient of the log-likelihood with respect to
a model parameter is a difference of moments – one calcu-
lated directly from the data and one calculated from our The samples from the model x0i ∈ Smodel are often re-
model using the current model parameters. The data- ferred to as fantasy particles in the ML literature and
dependent term is known as the positive phase of the can be generated using simple MCMC algorithms such
gradient and the model-dependent term is known as the as Metropolis-Hasting which are covered in most modern
negative phase of the gradient. This derivation also gives statistical physics classes. However, if the reader is unfa-
an intuitive explanation for likelihood-based training pro- miliar with MCMC methods or wants a quick refresher,
cedures. The gradient acts on the model to lower the en- we recommend the concise and beautiful discussion of
ergy of configurations that are near observed data points MCMC methods from both the physics and ML point-
while raising the energy of configurations that are far of-view in Chapters 29-32 of David MacKay’s masterful
from observed data points. Finally, we note that all infor- book (MacKay, 2003).
mation about the data only enters the training procedure Finally, we note that once we have the fantasy particles
through the expectations hOi (x)idata and our generative from the model, we can also easily calculate the gradient
model is blind to information beyond what is contained of any expectation value hf (x)imodel using what is com-
in these expectations. monly called the “log-derivative trick” in ML (Fu, 2006;
86
Kleijnen and Rubinstein, 1996): XVI. DEEP GENERATIVE MODELS: HIDDEN VARIABLES
AND RESTRICTED BOLTZMANN MACHINES (RBMS)
∂ ∂pθ (x)
Z
hf (x)imodel = dx f (x)
∂θi ∂θi The last section introduced many of the core ideas be-
hind energy-based generative models. Here, we extend
D ∂ log p (x) E
θ
= f (x)
∂θi model this discussion to energy-based models that include la-
= hOi (x)f (x)imodel tent or hidden variables.
X Including latent variables in generative models greatly
≈ Oi (xj )f (x0j ). (198)
enhances their expressive power – allowing the model to
x0j ∈Smodel
represent sophisticated correlations between visible fea-
This expression allows us to take gradients of more com- tures without sacrificing trainability. By having multiple
plex cost functions beyond the MLE procedure discussed layers of latent variables, we can even construct powerful
here. deep generative models that possess many of the same
desirable properties as deep, discriminative neural net-
works.
E. Summary of the training procedure We begin with a discussion that tries to provide a sim-
ple intuition for why latent variables are such a pow-
We now summarize the discussion above and present a erful tool for generative models. Next, we introduce a
general procedure for training an energy based model us- powerful class of latent variable models called Restricted
ing SGD on the cost function (see Sec. IV). Our goal is to Boltzmann Machines (RBMs) and discuss techniques for
fit the parameters of a model pλ ({θi }) = Z −1 e−E(x,{θi }) . training these models. After that, we introduce Deep
Training the model involves the following steps: Boltzmann Machines (DBMs), which have multiple layers
of latent variables. We then introduce the new Paysage
1. Read a minibatch of data, {x}.
package for training energy-based models and demon-
2. Generate fantasy particles {x0 } ∼ pλ using an strate how to use it on the MNIST dataset and sam-
MCMC algorithm (e.g., Metropolis-Hastings). ples from the Ising model. We conclude by discussing
recent physics literature related to energy-based genera-
3. Compute the gradient of log-likelihood using these tive models.
samples and Eq. (195), where the averages are
taken over the minibatch of data and the fantasy
particles from the model, respectively. A. Why hidden (latent) variables?
4. Use the gradient as input to one of the gradient
based optimizers discussed in section Sec. IV. Latent or hidden variables are a powerful yet elegant
way to encode sophisticated correlations between observ-
In practice, it is helpful to supplement this basic proce- able features. The underlying reason for this is that
dure with some tricks that help training. As with dis- marginalizing over a subset of variables – “integrating
criminative neural networks, it is important to initial- out” degrees of freedom in the language of physics – in-
ize the parameters properly and print summary statistics duces complex interactions between the remaining vari-
during the training procedure on the training and vali- ables. The idea that integrating out variables can lead
dation sets to prevent overfitting. These and many other to complex correlations is a familiar component of many
“cheap tricks” have been nicely summarized in a short physical theories. For example, when considering free
note from the Hinton group (Hinton, 2012). electrons living on a lattice, integrating out phonons gives
A major computational and practical limitation of rise to higher-order electron-electron interactions (e.g. su-
these methods is that it is often hard to draw samples perconducting or magnetic correlations). More generally,
from generative models. MCMC methods often have long in the Wilsonian renormalization group paradigm, all ef-
mixing-times (the time one has to run the Markov chain fective field theories can be thought of as arising from
to get uncorrelated samples) and this can result in bi- integrating out high-energy degrees of freedom (Wilson
ased sampling. Luckily, we often do not need to know and Kogut, 1974).
the gradients exactly for training ML models (recall that Generative models with latent variables run this logic
noisy gradient estimates often help the convergence of in reverse – encode complex interactions between visible
gradient descent algorithms), and we can significantly re- variables by introducing additional, hidden variables that
duce the computational expense by running MCMC for interact with visible degrees of freedom in a simple man-
a reasonable time window. We will exploit this observa- ner, yet still reproduce the complex correlations between
tion extensively in the next section when we discuss how visible degrees in the data once marginalized over (in-
to train more complex energy-based models with hidden tegrated out). This allows us to encode complex higher-
variables. order interactions between the visible variables using sim-
87
interact with one another but not among themselves. We see that the marginal energy includes all orders of in-
Specifying a generative model with this bipartite inter- teractions between the visible units, with the n-th order
action structure has two major advantages: (i) it enables cumulants of qµ (hµ ) weighting the n-th order interac-
capturing both pairwise and higher-order correlations be- tions between the visible units. In the case of the Hop-
tween the visible units and (ii) it makes it easier to sample field model we discussed previously, qµ (hµ ) is a standard
from the model using an MCMC method known as block (1)
Gaussian distribution where the mean is κµ = 0, the
Gibbs sampling, which in turn makes the model easier to (2)
variance is κµ = 1, and all higher-order cumulants are
train. zero. Plugging these cumulants into Eq. (210) recovers
Before discussing training, it is worth better under- Eq. (202).
standing the kind of correlations that can be captured These calculations make clear the underlying reason
using an RBM. To do so, we can marginalize over the hid- for the incredible representational power of RBMs with
den units and ask about the resulting distribution over a Bernoulli hidden layer. Each hidden unit can encode in-
just the visible units teractions of arbitrarily high order. By combining many
Z Z
e−E(v,h) different hidden units, we can encode very complex in-
p(v) = dhp(v, h) = dh (206) teractions at all orders. Moreover, we can learn which
Z
order of correlations/interactions are important directly
where the integral should be replaced by a trace in all from the data instead of having to specify them ahead of
expressions for discrete units. time as we did in the MaxEnt models. This highlights
We can also define a marginal energy using the expres- the power of generative models with even the simplest in-
sion teractions between visible and latent variables to encode,
e−E(v) learn, and represent complex correlations present in the
p(v) = . (207) data.
Z
89
Gibbs sampling, with n often taken to be as small as 1 Deep Boltzmann Layerwise Fine-tuning with
(see Figure 62)! The price for this truncation is, of course, Machine (DBM) Pretraining PCD on full DBM
that we are not drawing samples from the true model dis-
tribution. But for our purpose – using the expectations
to estimate the gradient for SGD – CD-n has proven to
work reasonably well. As long as the approximate gra-
dients are reasonably correlated with the true gradient,
SGD will move in a reasonable direction. CD-n of course
does come at a price. Truncating the Gibbs sampler pre-
vents sampling far away from the starting point, which
for CD-n are the data points in the minibatch. Therefore,
our generative model will be much more accurate around
regions of feature space close to our training data. Thus, FIG. 63 Deep Boltzmann Machine contain multiple hidden
as is often the case in ML, CD-n sacrifices the ability layers. To train deep networks, first we perform layerwise
to generalize to some extent in order to make the model training where each two layers are treated as a RBM. This
easier to train. can be followed by fine-tuning using gradient descent and per-
Some of these undesirable features can be tempered sistent contrastive divergence (PCD).
by using a slightly different variant of CD called Persis-
tent Contrastive Divergence (PCD) (Tieleman and Hin-
ton, 2009). In PCD, rather than restarting the Gibbs σ = 0.01 (Hinton, 2012). An alternative initial-
sampler from the data at each gradient descent step, we ization scheme proposed by Glorot and Bengio in-
start the Gibbs sampling at the fantasy particles in the stead chooses the standard deviation
√ to scale with
last gradient descent step (see Fig. 62). Since parameters the size of the layers: σ = 2/ Nv + Nh where Nv
change slowly compared to the Gibbs sampling, samples and Nh are number of visible and hidden units re-
that are high probability at one step of the SGD are also spectively (Glorot and Bengio, 2010). The bias of
likely to be high probability at the next step. This en- the hidden units is initialized to zero while the bias
sures that PCD does not introduce large errors in the of the visible units is typically taken to be inversely
estimation of the gradients. The advantage of using fan- proportional to the mean activation, ai = hvi i−1 data .
tasy particles to initialize the Gibbs sampler is to allow
• Regularization.—One can of course use an L1 or
PCD to explore parts of the feature space that are much
L2 penalty, typically only on the weight parame-
further from the training dataset than one could reach
ters, not the biases. Alternatively, Dropout has
with ordinary CD.
been shown to decrease overfitting when training
We note that, in applications using RBMs as a vari- with CD and PCD, which results in more inter-
ational ansatz for quantum states, Gibbs sampling is pretable learned features.
not necessarily the best option for training, and in prac-
tice parallel tempering or other Metropolis schemes can • Learning Rates.—Typically, it is helpful to re-
outperform Gibbs sampling. In fact, Gibbs sampling is duce the learning rate in later stages of training.
not even feasible with complex-valued weights required
for quantum wavefucntions, whereas Metropolis schemes • Updates for CD and PCD.—There are several
might be feasible (Carleo, 2018). computational tricks one can use for speeding up
the alternating updates in CD and PCD, see Sec-
tion 3 in (Hinton, 2012).
2. Practical Considerations
The previous section gave an overview of how to train D. Deep Boltzmann Machine
RBMs. However, there are many “tricks of the trade”
that are missing from this discussion. Luckily, a succinct In this section, we introduce Deep Boltzmann Ma-
summary of these has been compiled by Geoff Hinton and chines (DBMs). Unlike RBMs, DBMs possess multi-
published as a note that readers interested in training ple hidden layers and were the first models rebranded
RBMs are urged to consult (Hinton, 2012). as “deep learning” (Hinton et al., 2006; Hinton and
For completeness, we briefly list some of the important Salakhutdinov, 2006) 18 . Many of the advantages that
points here:
FIG. 66 MC samples, their reconstructions and fantasy particles generated by a Deep Boltzmann Machine in the ordered
phase of the the 2D Ising data set at T /J = 1.75. We used two hidden layers of 1000 and 100 layers, respectively.
FIG. 67 MC samples, their reconstructions and fantasy particles generated by a Deep Boltzmann Machine in the critical
regime of the the 2D Ising data set at T /J = 2.25. We used two hidden layers of 1000 and 100 layers, respectively.
linearities in the activation functions of hidden units, tions in the study of quantum systems too. Most no-
and the adaptation of fields maintaining the activity in tably, RBM-inspired variational ansatzes were used to
the visible layer (Tubiana and Monasson, 2017). Spin learn both complex-valued wavefunctions and the real-
glass theory motivated a deterministic framework for valued probability distribution associated with the abso-
the training, evaluation, and use of RBMs (Tramel lute square of a quantum state (Carleo et al., 2018; Car-
et al., 2017); it was demonstrated that the training pro- leo and Troyer, 2017; Freitas et al., 2018; Nomura et al.,
cess in RBMs itself exhibits phase transitions (Barra 2017; Torlai et al., 2018) and, in this context, RBMs are
et al., 2016, 2017); learning in RBMs was studied in the sometimes called Born machines (Cheng et al., 2017), in-
context of equilibrium (Cossu et al., 2018; Funai and cluding quantum state tomorgraphy (Carrasquilla et al.,
Giataganas, 2018) and nonequilibrium (Salazar, 2017) 2018; Torlai et al., 2018; Torlai and Melko, 2017). Fur-
thermodynamics, and spectral dynamics (Decelle et al., ther applications include the detection of order in low-
2017); mean-field theory found application in analyzing energy product states (Rao et al., 2017), and learning
DBMs (Huang, 2017a). Another interesting direction of Einstein-Podolsky-Rosen correlations on an RBM (Wein-
research is the use of generative models to improve Monte stein, 2017). Inspired by the success of tensor networks in
Carlo algorithms (Cristoforetti et al., 2017; Nagai et al., physics, the latter have been used as a basis for both gen-
2017; Tanaka and Tomiya, 2017b; Wang, 2017). Ideas erative and discriminative learning (Huggins et al., 2019):
from quantum mechanics have been put forward to in- RBMs (Chen et al., 2018) were used to extract the spa-
troduce improved speed-up in certain parts of the learn- tial geometry from entanglement (You et al., 2017), and
ing algorithms for Helmholtz machines (Benedetti et al., generative models based on matrix product states have
2016, 2017). been developed (Han et al., 2017). Last but not least,
Quantum entanglement was studied using RBM-encoded
At the same time, generative models have applica-
94
FIG. 68 MC samples, their reconstructions and fantasy particles generated by a Deep Boltzmann Machine in the disordered
phase of the the 2D Ising data set at T /J = 2.75. We used two hidden layers of 1000 and 100 layers, respectively.
states (Deng et al., 2017) and tensor product based gen- come some of these limitations, simultaneously highlight-
erative models have been used to understand MNIST and ing both the power of GANs and some of the difficulties.
other ML datasets (Stoudenmire and Schwab, 2016). We then show how VAEs integrate the variational meth-
ods introduced in Sec. XIV with deep, differentiable neu-
ral networks to build more powerful generative models
XVII. VARIATIONAL AUTOENCODERS (VAES) AND that move beyond the Expectation Maximization (EM).
GENERATIVE ADVERSARIAL NETWORKS (GANS)
We then briefly discuss VAEs from an information theo-
retic perspective, before discussing practical tips for im-
In the previous two sections, we considered energy-
plementing and training VAEs. We conclude by using
based generative models. Here, we extend our discus-
VAEs on examples using the Ising and MNIST datasets
sion to two new generative model frameworks that have
(see also Notebooks 19 and 20).
gained wide appeal in the the last few years: generative
adversarial networks (GANs) (Goodfellow, 2016; Good-
fellow et al., 2014; Radford et al., 2015) and variational A. The limitations of maximizing Likelihood
autoencoders (VAEs) (Kingma and Welling, 2013). Un-
like energy-based models, both these generative modeling The Kullback-Leibler (KL)-divergence plays a central
frameworks are based on differentiable neural networks role in many generative models. Developing an intuition
and consequently can be trained using backpropagation- about KL-divergences is one of the keys to understanding
based methods. VAEs, in particular, can be easily im- why adversarial learning has proved to be such a powerful
plemented and trained using high-level packages such as method for generative modeling. Here, we revisit the KL-
Keras making them an easy-to-deploy generative frame- divergence with an eye towards understanding GANs and
work. These models also differ from the energy-based motivate adversarial learning. The KL-divergence mea-
models in that they do not directly seek to maximize like- sures the similarity between two probability distributions
lihood. GANs, for example, employ a novel cost function p(x) and q(x). Strictly speaking, the KL divergence is
based on adversarial learning (a concept we motivate and not a metric because it is not symmetric and does not
explain below). Finally we note that VAEs and GANs are satisfy the triangle inequality.
already starting to make their way into physics (Heimel Given two distributions, there are two distinct KL-
et al., 2018; Liu et al., 2017; Rocchetto et al., 2018; Wet- divergences we can construct:
zel, 2017) and astronomy (Ravanbakhsh et al., 2017), and Z
p(x)
methods from physics may prove useful for furthering DKL (p||q) = dxp(x) log (214)
q(x)
our understanding of these methods (Alemi and Abbara,
q(x)
Z
2017). More generally, GANs have found important ap- DKL (q||p) = dxq(x) log . (215)
plications in many artistic and image manipulation tasks p(x)
(see references in (Goodfellow, 2016)). A related quantity called the Jensen-Shannon divergence,
The section is organized as follows. We start by moti-
1
p + q
p + q
vating adversarial learning by discussing the limitations DJS (p, q) = DKL p
+ DKL q
of maximum likelihood based approaches. We then give 2 2
2
a high-level introduction to the main idea behind gen- does satisfy all of the properties of a squared metric (i.e.,
erative adversarial networks and discuss how they over- the square root of the Jensen-Shannon divergence is a
95
∆ = 2.0 ∆ = 5.0
Model Model
Data Data
15
10
0
0.0 0.5 1.0 1.5 2.0 2.5 3.0 −4 −2 0 2 4
∆ x
FIG. 69 KL-divergences between the data distribution pdata
and the model pθ . Data is drawn from a bimodal Gaus- Data-Model
sian distribution with unit variances peaked at ±∆ with 5
Model-Data
∆ = 2.0 and the model pθ (x) is a Gaussian with mean zero 4
and same variance as pθ (x). (Top) pdata and pθ for ∆ = 2.
(Bottom) DKL (pdata ||pθ ) (Data-Model) and DKL (pθ ||pdata ) 3
(Model-Data) as a function of ∆. Notice that DKL (pdata ||pθ )
is insensitive to placing weight in the model distribution in 2
regions where pdata ≈ 0 whereas DKL (pθ ||pdata ) punishes this
harshly. 1
0
0 2 4 6 8 10
∆
FIG. 70 KL-divergences between the data distribution pdata
and the model pθ . Data is drawn from a Gaussian mixture
metric). An important property of the KL-divergence of the form pdata = 0.25N (−∆) + 0.25 ∗ N (∆) + 0.5N (0)
that we will make use of repeatedly is its positivity: where N (a) is a normal distribution with unit variance cen-
DKL (p||q) ≥ 0 with equality if and only if p(x) = q(x) tered at x = a. pθ (x) is a Gaussian with σ 2 = 2. (Top)
pdata and pθ for ∆ = 5. (Middle) pdata and pθ for ∆ = 1.
almost everywhere.
(Bottom) DKL (pdata ||pθ ) [Data-Model] and DKL (pθ ||pdata )
[Model-Data] as a function of ∆. Notice that DKL (pθ ||pdata )
is insensitive to placing weight in the model distribution in
In generative models in ML, the two distributions regions where pθ ≈ 0 whereas DKL (pdata ||pθ ) punishes this
we are usually concerned with are the model distribu- harshly .
tion pθ (x) and the data distribution pdata (x). We of
course would like these models to be as similar as possi-
ble. However, as we discuss below, there are many sub-
tleties about how we measure similarities that can have
large consequences for the behavior of training proce-
dures. Maximizing the log-likelihood of the data under
the model is the same as minimizing the KL divergence
between the data distribution and the model distribu-
tion DKL (pdata ||pθ ). To see this, we can rewrite the KL
96
divergence as:
D(x) tries to make
D(G(z))be near 0
Z
DKL (pdata ||pθ ) = dxpdata (x) log pdata (x)
Z G tries to make
− dxpdata (x) log pθ (x) D(G(z))be near 1
V (D, G) = Ex∼pdata (log D(x)) FIG. 72 VAEs learn a joint distribution pθ (x, z) between
latent variables z with prior distribution p(z) and data x.
+ Ez∼pprior (log [1 − D(G(z))]) . (218) The conditional distribution pθ (x|z) can be thought of as a
stochastic “decoder” that maps latent variables to new ex-
In the version of GANs most amenable to theoretical amples. The stochastic “encoder” qφ (z|x) approximates the
analysis – though not the version usually implemented true but intractable pθ (z|x) – much like mean-field theories
in practice – we take the cost function for the discrimi- in statistical physics approximate true distributions with ana-
nator and generators to be C (G) = −C (D) = 12 V (D, G). lytically tractable approximations. Figure based on Kingma’s
This choice of cost functions corresponds to what is called Ph.D. dissertation Chapter 2. (Kingma et al., 2017).
a zero-sum game. Since the discriminator is maximized,
we can write a cost function for the generator as
DNN. The use of latent variables is a common theme
C(G) = max V (G, D). (219) in many of the generative models we have encountered in
D unsupervised learning tasks from Gaussian Mixture Mod-
It turns out that this cost function is related to the els (see Sec. XIII) to Restricted Boltzmann Machines.
Jensen-Shannon Divergence in a simple manner (Good- However, in VAEs this mapping, p(x|z, θ) is much less
fellow, 2016; Goodfellow et al., 2014): restrictive and much more complicated since it takes the
form of a DNN. This added complexity means we can-
C(G) = − log 4 + 2DJS (pdata , pθG ). (220) not use techniques such as Expectation Maximization to
train the model and instead must rely of methods based
This brings us back full circle to the discussion in the last on backpropagation.
section on KL-divergences.
to be a multivariate Gaussian. The conditional distribu- The second term acts as a regularizer and encourages the
tion pθ (x|z) maps points in the latent space to new ex- posterior distributions to be close to p(z). By maximizing
amples (see Fig. 72). This is often called a “stochastic the ELBO, we minimize the KL-divergence between the
decoder” and defines the generative model for the data. approximate and true posterior. By choosing a tractable
The reverse mapping that gives the posterior over the qφ (z|x), we make this feasible (see Fig. 72).
latent variables pθ (z|x) is often called the “stochastic en-
coder”.
A central challenge in latent variable modeling is to in- 2. Training via the reparametrization trick
fer the posterior distribution of the latent variables given
a sample from the data. This can in principle be done VAEs train models by minimizing the variational free
energy (maximizing the ELBO). Training a VAE is some-
via Bayes’ rule: pθ (z|x) = p(z)p θ (x|z)
. For some models,
pθ (x)
what complicated because we must simultaneously learn
we can calculate this analytically. In this case, we can
two sets of parameters: the parameters θ that define our
use techniques like Expectation Maximization (EM) (see
generative model pθ (x, z) as well as the variational pa-
Sec. XIV). However, in general this is intractable since
rameters φ in qφ (z|x). The basic approach will be the
the denominator requires computing a sum R over all con- same as for all DNN models: we will use gradient de-
figurations of the latent variables, p θ (x) = pθ (x, z)dz =
scent with the variational free energy as the objective
pθ (x|z)p(z)dz (i.e. a partition function in the language
R
(cost) function. For a dataset L, we can write our cost
of physics), which is often intractable for large models.
function as
In VAEs, where the pθ (x|z) is modeled using a DNN, this X
is impossible. Cθ,φ (L) = −Fqφ (x). (224)
A first attempt to address the issue of computing x∈L
p(x) could be through importance sampling (Neal, 2001). Taking the gradient with respect to θ is easy since only
That is, we choose a proposal distribution q(z|x) which the first term in Eq. (223) depends on θ,
is easy to sample from, and rewrite the sum as an expec-
tation with respect to this distribution: Cθ,φ (x) = Eqφ (z|x) [∇θ log pθ (x|z)]
∼ ∇θ log pθ (x|z) (225)
p(z)
Z
pθ (x) = pθ (x|z) qφ (z|x)dz. (221) where in the second line we have replaced the expec-
qφ (z|x)
tation value with a single Monte-Carlo sample z drawn
Thus, by sampling from qφ (z|x) we can get a Monte Carlo from qφ (z|x) (see Fig. XVII.C.2). When pθ (x|z) is ap-
estimate of p(x). However, this requires generating sam- proximated by a neural network, this can be calculated
ples and thus our estimates will be noisy. If our proposal using backpropagation with the reconstruction error as
distribution is poor, the variance in the estimate can be the objective function.
very high. On the other hand, calculating the gradient with re-
An alternative approach that avoids these sampling spect to the parameters φ is more complicated since φ
issues is to use the variational approach discussed in also appears in the expectation value Eqφ (z|x) . Ideally, we
Sec. XIV. We know from Eq. (162) that we can write would like to also use backpropagation to calculate this
the log-likelihood as as well. It turns out that this can be done by a simple
log p(x) = DKL (qφ (z|x)kpθ (z|x, θ)) − Fqφ (x), (222) change of variables that often goes under the name the
“reparameterization trick” (Kingma and Welling, 2013;
where the variational free energy is defined as Rezende et al., 2014). The basic idea is to change vari-
ables so that φ no longer appears in the distribution we
− Fqφ (x) ≡ Eqφ (z|x) [log pθ (x|z)] − DKL (qφ (z|x)|p(z)). are taking an expectation value with respect to. To do
(223) this, we express the random variable z ∼ qφ (z|x) as some
In writing this term, we have used Bayes rule and differentiable and invertible transformation of another
Eq. (174). Since the KL-divergence is strictly positive, random variable :
the (negative) variational free energy is a lower-bound on
the log-likelihood. For this reason, in the VAE literature, z = g(, φ, x), (226)
it is often called the Evidence Lower BOund or ELBO.
where the distribution of is independent of x and φ.
Equation (223) has a beautiful interpretation. The
Then, we can replace expectation values over qφ (z|x) by
first term in this equation can be viewed as a “recon-
expectation values over p
struction error”, where we start with data x, encode it
into the latent representation using our approximate pos- Eqφ (z|x) [f (z)] = Ep [f (z)]. (227)
terior qφ (z|x), and then evaluate the log probability of
Evaluating the derivative then becomes quite straight for-
the original data given the inferred latents. For binary
ward since
variables, this is just the cross-entropy which we first en-
countered when studying logistic regression, cf. Sec. VII. ∇φ Eqφ (z|x) [f (z)] ∼ Ep [∇φ f (z)]. (228)
99
Datapoint
Negative
Variational Free Energy:
(ELBO)
E [log pθ(x|z) - KL(qφ(z|x)||p(z))]
q (z|x)
φ
FIG. 73 Schematic explaining the computational flow of VAEs. Figure based on Kingma’s Ph.D. dissertation Chapter 2.
(Kingma et al., 2017).
Of course, when we do this we still need to be able to These observations hints at the more general connec-
calculate the Jacobian of this change of variables tion between VAEs and information theory that we turn
to in the next section.
∂z
dφ (x, φ) = Det (229)
∂
since 3. Connection to the information bottleneck
log qφ (z|x) = log p() − log dφ (x, φ). (230) There is a fundamental connection between the vari-
ational autoencoder objective and the information bot-
Since we can calculate gradients, we can now use back- tleneck (IB) for lossy compression (Tishby et al., 2000).
propagation on the full the ELBO objective function (we The information bottleneck imagines we have input data
return to this below when we discuss concrete architec- x that is correlated with another variable of interest, y,
tures and implementations of VAE). and we are given access to the joint distribution, p(x, y).
One of the problems that commonly occurs when train- Our task is to take x as input and compress it in such a
ing VAEs by performing a stochastic optimization of the way as to retain as much information as possible about
ELBO (variational free energy) is that it often gets stuck the relevance variable, y. To do this, Tishby et al. pro-
in undesirable local minima, especially at the beginning pose to maximize the objective function
of the training procedure (Bowman et al., 2015; Kingma
et al., 2017; Sønderby et al., 2016). The underlying rea-
son for this is that the ELBO objective function can be
LIB = I(y; z) − βI(x; z) (232)
improved in two qualitatively different ways correspond-
ing to each of the two terms in Eq. (223): by minimizing
over a stochastic encoding distribution q(z|x), where z is
the reconstruction error or by making the posterior dis-
our compression of the input, and β is a tradeoff param-
tribution qφ (z|x) to be close to p(z) (Of course, the goal
eter that sets the relative preference of compression and
is to do both!). For complex datasets, at the beginning of
accuracy, and I(y; z) is the mutual information between y
training when the reconstruction error is extremely poor,
and z. Note that we choose a slightly different but equiv-
the model often quickly learns to make q(z|x) ≈ p(z) and
alent form of the objective relative to Tishby et al.. This
gets stuck in this local minimum. For this reason, in prac-
objective is only known to have a closed-form solution
tice it is found that it makes sense to modify the ELBO
when x and y are jointly Gaussian (Chechik et al., 2005).
objective to use an optimization schedule of the form
Otherwise, the optimization can be performed through a
Eqφ (z|x) [log pθ (x|z)] − βDKL (qφ (z|x)|p(z)) (231) Blahut-Arimoto type iterative update scheme (Arimoto,
1972; Blahut, 1972). However, this is only guaranteed to
where β is slowly annealed from 0 to 1 (Bowman et al., converge to a local optimum. A significant difficulty in
2015; Sønderby et al., 2016). An alternative regulariza- implementing IB is that it requires knowledge of the joint
tion is the “method of free bits”: modifying the objective distribution p(x, y) and that we must be able to compute
function of ELBO to ensure that on average qφ (z|x) has the mutual information, a notoriously difficult quantity
at least λ natural units of information about p(z) (see to estimate from samples. Hence, IB has in recent years
Kingma Ph.D thesis (Kingma et al., 2017) for details) . been utilized less than it might otherwise.
100
(233)
FIG. 74 Computational graph for a VAE with Gaussian hid-
we have den units (i.e. p(z) are standard normal variables N (0, 1) and
Z
p(x|z)
Gaussian variational encoder whose posterior takes the form
I(x; z) = dxdz p(x)p(z|x) log qφ (z|x) = N (µ(x), σ 2 (x)).
p(x)
Z
≥ dxdz p(x)p(z|x) log q(x|z) + Hp (x)
x, which is irrelevant in the optimization procedure. In
fact, this objective has been explored and is called a β-
Z
≥ dxdz p(x)p(z|x) log q(x|z), (234)
VAE (Higgins et al., 2016). It’s interesting to note that in
the case of IB, the variational approximations are with
where Hp (x) ≥ 0 is the Shannon entropy of x. This respect to the decoder and prior, whereas in the VAE,
quantity can be estimated from data samples (i, xi ) af- the variational approximations are with respect to the
ter drawing from p(z|i) = p(z|xi ). Similarly, we can encoder.
replace the prior distribution of the encoding, p(z) =
dx p(x)q(z|x) which is typically intractable, with a
R
tractable q(z) to get D. VAE with Gaussian latent variables and Gaussian encoder
1 X p(z|xi )
Z
I(i; z) ≤ dz p(z|xi ) log (235) Our discussion of VAEs thus far has been quite ab-
N i q(z) stract. In this section, we discuss one of the most widely
employed VAE architectures: a VAE with factorized
Putting these two bounds Eqs. (234)and (235) together Gaussian posteriors, qφ (z|x) = N (z, µ(x), diag(σ 2 (x)))
and note that x = i and y = xi , we get an upper bound and standard normal latent variables p(z) = N (0, I).
for the IB objective that takes the same form as the VAE The training and implementation simplifies greatly
objective Eq. (231) we saw earlier: here because we can analytically workout the term
DKL (qφ (z|x)|p(z)).
LIB = I(x; z) − βI(y; z)
Z
≤ dx p(x)Ep(z|x) [log q(x|z)] (236)
1. Implementing the Gaussian VAE
1 X
−β DKL (p(z|xi )|q(z)). (237)
N i We now show how we can combine analytic expressions
for the KL-divergence with backpropagation to efficiently
Note that in Eq. (236) we have a conditional distribution implement a Gaussian VAE. We start by first deriving an-
of x given z but not their joint distribution inside the alytic expressions for DKL (qφ (z|x)|p(z)) in terms of the
expectation, which was the case in Eq. (231). This is means µ(x) and variances σ 2 (x). This is just a simple ex-
due to that we dropped the entropy term pertaining to ercise in Gaussian integrals. For notational convenience,
101
one of the reasons that generative models are one of the We hope the review catalyzes more research at the
cutting edge areas of modern Machine Learning research intersection of physics and machine learning. Here we
and there are likely to be a barrage of new techniques for briefly highlight a few promising research directions. We
generative modeling in the next few years. note that this list is far from comprehensive.
• Applying ML to solve physics problems. One
theme that has reoccurred through out the review
XVIII. OUTLOOK is that ML is most effective in settings with well de-
fined objectives and lots of data. For this reason,
In this review, we have attempted to give the reader the we expect ML to become a core competency of data
intellectual and practical tools to engage with Machine rich fields such as high-energy experiments and as-
Learning (ML), data science, and parts of modern statis- tronomy. However, ML may also prove to be use-
tics. We have tried to emphasize that ML differs from ful for helping further our physical understanding
ordinary statistics in that the goal is to predict rather through data-driven approach to other branches of
than to fit. For this reason, all the techniques discussed physics that may not be immediately obvious, such
here have to navigate important tensions that lie at the as quantum physics (Dunjko and Briegel, 2017).
heart of ML. The most prominent instantiation of these For example, recent works have used ideas from
inherent tradeoffs is the bias-variance tradeoff, which is ML to investigate disparate topics such as non-local
perhaps the only universal principle in ML. Identifying correlations (Canabarro et al., 2018), disordered
how these tradeoffs manifest in a particular algorithm is materials and glasses (Schoenholz, 2017), electronic
the key to constructing and training powerful ML meth- structure calculations (Grisafi et al., 2017) and
ods. numerical analysis of ferromagnetic resonances in
The immense progress in computing power and the thin films (Tomczak and Puszkarski, 2018), de-
corresponding availability of large datasets ensure that signing and analyzing quantum materials by inte-
ML will be an important part of the physics toolkit. In grating ML with existing techniques such as Dy-
the future, we expect ML to be a core competency of namical Mean Field Theory (DMFT) (Arsenault
physicists much like linear algebra, group theory, and et al., 2014), in the study of inflation (Rudelius,
104
2018), and even for experimental learning of quan- biophysics toolkit in the future. Many of the au-
tum states by using ML to aid in quantum tomog- thors of this review were inspired to engage with
raphy (Rocchetto et al., 2017). For a comprehen- ML for this reason.
sive review of ML methods in seismology, see (Kong
et al., 2018). • Using ideas from physics to develop new
ML algorithms. Many of the core ideas of ML
• Machine Learning on quantum computers. from Monte-Carlo techniques to variational meth-
Another interesting area of research that is likely ods have their origin in physics. There has been a
to grow is asking if and how quantum comput- tremendous amount of recent work developing tools
ers can help improve state-of-the art ML algo- to understand physical systems that may be of po-
rithms (Arunachalam and de Wolf, 2017; Benedetti tential use to ML. For example, in quantum con-
et al., 2016, 2017; Bromley and Rebentrost, 2018; densed matter techniques such as DMRG, MERA,
Ciliberto et al., 2017; Daskin, 2018; Innocenti et al., etc. have enriched both our practical and con-
2018; Mitarai et al., 2018; Perdomo-Ortiz et al., ceptual understandings (Stoudenmire and White,
2017; Rebentrost et al., 2017; Schuld et al., 2017; 2012; Vidal, 2007; White, 1992). It will be inter-
Schuld and Killoran, 2018; Schuld et al., 2015). esting to figure how and if these numerical methods
Concrete examples that seek to extend some of can be translated from a physics to a ML setting.
the basic ideas and methods we introduced in There are tantalizing hints that this is likely to be
this review to the quantum computing realm in- a fruitful direction (Han et al., 2017; Stoudenmire,
clude: algorithms for quantum-assisted gradient 2018; Stoudenmire and Schwab, 2016).
descent (Kerenidis and Prakash, 2017; Rebentrost
et al., 2016), classification (Schuld and Petruccione,
2017), and Ridge regression (Yu et al., 2017). Inter- B. Topics not covered in review
est in this field will undoubtedly grow once reliable
quantum computers become available (see also this Despite the considerable length of the review, we have
recent review (Dunjko and Briegel, 2017) ). had to make many omissions for the sake of brevity. It
is our hope and belief that after reading this review the
• Monte-Carlo Methods. An interesting area that reader will have the conceptual and practical knowledge
has seen a renewed interest with Bayesian modeling to quickly learn about these other topics. Among the
is the development of new Monte-Carlo methods for most prominent topics missing from this review are:
sampling complex probability distributions. Some
of the workhorses of modern Machine Learning – • Temporal/Sequential Data. We have not cov-
Annealed Importance Sampling (AIS) (Neal, 2001) ered techniques for dealing with temporal or se-
and Hamiltonian or Hybrid Monte-Carlo (HMC) quential data. Here, too there are many connec-
(Neal et al., 2011) – are intimately related to tions with statistical physics. A powerful class of
physics. As pointed out by Radford Neal, AIS is models for sequential data called Hidden Markov
just the Jarzynski inequality (Jarzynski, 1997) as Models (Rabiner, 1989) that utilize dynamical
a Monte-Carlo method and HMC was developed programming techniques have natural statistical
by physicists and exploits Hamiltonian dynamics physics interpretations in terms of transfer matri-
to improve proposal distributions. ces (see (Mehta et al., 2011) for explicit exam-
ple of this). Recently, Recurrent Neural Networks
• Statistical physics style theory of Deep (RNNs) have become an important and powerful
Learning. Many techniques in ML have origins tool for dealing with sequence data (Goodfellow
in statistical physics. Yet, a physics-style theory et al., 2016). RNNs generalize many of the ideas
of Deep Learning remains elusive. A key question discussed in the DNN section to deal with temporal
is to ask when and why these models manage to data.
generalize well. Physicists are only beginning to
ask these questions (Advani and Saxe, 2017; Mehta • Reinforcement Learning. Many of the most ex-
and Schwab, 2014; Saxe et al., 2013; Shwartz-Ziv citing developments in the last five years have come
and Tishby, 2017). But right now, it is fair to say from combining ideas from reinforcement learning
that the insights remain scattered and a cohesive with deep neural networks (Mnih et al., 2015; Sut-
theoretical understanding is lacking. ton and Barto, 1998). RL traces its origins to be-
haviourist psychology, when it was conceived as
• Biological physics and ML. Biological physics a way to explain and study reward-based deci-
is generating ever more datasets in fields ranging sion making. RL was put on solid mathematical
from neuroscience to evolution and immunology. It grounds in the 50’s by Richard Bellman and col-
is likely that ML will be an important part of the laborators, and has by now become an inseparable
105
part of robotics and artificial intelligence. RL is a that form the basis of modern ML with the more com-
field of Machine Learning, in which an agent learns monplace notions about what humans and behavioral sci-
how to master performing a specific task through entists mean by intelligence (see (Lake et al., 2017) for
an interaction with its environment. Depending on an enlightening and important modern discussion of this
the reward it receives, the agent chooses to take an distinction from a quantitative cognitive science point of
action affecting the environment, which in turn de- view as well as (Dreyfus, 1965) for a surprisingly relevant
termines the value of the next received reward, and philosophy-based critique from 1965).
so on. The long-term goal of the agent is to max- Almost all the techniques discussed here rely on op-
imise the cumulative expected return, thus improv- timizing a pre-specified objective function on a given
ing its performance in the longer run. Shadowed by dataset. Yet, we know that for large, complex models
more traditional optimal control algorithms, Re- changing the data distribution or the goal can lead to an
inforcement Learning has only recently taken off immediate degradation of performance. Deep networks
in physics (Albarran-Arriagada et al., 2018; Au- have poor generalizations to even a slightly different con-
gust and Hernández-Lobato, 2018; Bukov, 2018; text (the infamous Validation-Test set mismatch). This
Bukov et al., 2018; Cárdenas-López et al., 2017; inability to abstract and generalize is a common criticism
Chen et al., 2014; Chen and Xue, 2019; Dunjko lobbied against branding modern ML techniques as AI
et al., 2017; Fösel et al., 2018; Lamata, 2017; Mel- (Lake et al., 2017). For all these reasons, we have chosen
nikov et al., 2017; Neukart et al., 2017; Niu et al., to use the term Machine Learning rather than artificial
2018; Ramezanpour, 2017; Reddy et al., 2016b; Sri- intelligence through out the review.
arunothai et al., 2017; Sweke et al., 2018; Zhang This is far from the first time we have seen the use of
et al., 2018). Of particular interest are biophysics the term artificial intelligence and the grandiose promises
inspired works that seek to use RL to understand that it implies. In fact, the early 1950’s and 1960’s as
navigation and sensing in turbulent environments well as the early 1980’s saw similar AI bubbles (see this
(Colabrese et al., 2017; Masson et al., 2009; Reddy interesting summary by Luke Muehlhauser for Open Phi-
et al., 2016a; Vergassola et al., 2007). lanthropy (Muehlhauser, 2016)). These AI bubbles have
been followed by what have been dubbed “AI Winters”
• Support Vector Machines (SVMs) and Ker-
(McDermott et al., 1985).
nel Methods. SVMs and kernel methods are a
powerful set of techniques that work well when the The “Singularity” may not be coming but the advances
amount of training data is limited (Burges, 1998). in computing and the availability of large data sets likely
The mathematics and theory of SVM are very dif- ensure that the kind of statistical learning frameworks
ferent from statistical physics and for this reason discussed are here to stay. Rather than a general arti-
we chose not to include them here. However, SVMs ficial intelligence, the kind of techniques presented here
and kernel methods have played an extremely im- seem to be best suited for three important tasks: (a)
portant role in ML and are worth understanding. automating prediction from lots of labeled examples in
a narrowly-defined setting (b) learning how to parame-
terize and capture the correlations of complex probabil-
C. Rebranding Machine Learning as “Artificial Intelligence” ity distributions, and (c) finding policies for tasks with
well-defined goals and clear rules. We hope that this
The immense scientific progress in ML has also been review has given the reader enough conceptual tools to
accompanied by a massive public relations effort cen- start forming their own opinions about reality and hype
tered around Silicon Valley. Starting with the success when it comes to modern ML research. As Michael I.
of ImageNet (the most prominent early use of GPUs Joran puts it, “...if the acronym “AI” continues to be
for training large models) and the widespread adoption used as placeholder nomenclature going forward, letâĂŹs
of Deep Learning based techniques by the Silicon Val- be aware of the very real limitations of this placeholder.
ley companies, there has been a deliberate move to re- LetâĂŹs broaden our scope, tone down the hype and rec-
brand modern ML as “artificial intelligence” or AI (see ognize the serious challenges ahead "(Jordan, 2018).
graphs in (Katz, 2017)). Recently, computer scientist
Michael I. Jordan (who is famously known for his formal-
ization of variational inference, Bayesian network, and D. Social Implications of Machine Learning
expectation-maximization algorithm in machine learn-
ing research) cautioned that “This confluence of ideas The last decade has also seen a systematic increase in
and technology trends has been rebranded as “AI” over the use and deployment of Machine Learning techniques
the past few years. This rebranding is worthy of some into new areas of life and society. Some of the readers of
scrutiny”(Jordan, 2018). this review may currently be (or eventually be) employed
AI, by design, is an ambiguous term that mixes aspi- in industrial settings that seek to harness ML for practi-
rations with reality. It also conflates the statistical ideas cal purposes. However, caution is in order when applying
106
ML. Without foresight and accountability, the scale and was supported as a Simons Investigator in the MMLS and
scope of modern ML algorithms can lead to large scale by NIH K25 grant GM098875-02. PM and DJS would
unaccountable and undemocratic outcomes that can re- like to thank the NSF grant: PHYD1066293 for support-
inforce or even worsen existing inequality and inequities. ing the Aspen Center for Physics (ACP) for facilitating
Mathematician and data scientist turned social commen- discussions leading to this work. This research was sup-
tator Cathy O’Neil has dubbed the indiscriminate use of ported in part by the National Science Foundation under
these Big Data techniques “Weapons of Math Destruc- Grant No. NSF PHY-1748958. The authors are pleased
tion” (O’Neil, 2017). to acknowledge that the computational work reported on
When ML is used in a social context, abstract statis- in this paper was performed on the Shared Computing
tical relationships have real social consequences. False Cluster which is administered by Boston University’s Re-
positives can mean the difference between life and death search Computing Services.
(for example in the context of “signature drone strikes”)
(Mehta, 2015). ML algorithms, like all techniques, have
important limitations and should be employed with great Appendix A: Overview of the Datasets used in the Review
caution. It is our hope that ML practitioners keep this
in mind when working in social settings. 1. Ising dataset
All algorithms involve inherent tradeoffs in fairness, a
point formalized by computer scientist Jon Kleinberg and The Ising dataset we use throughout the review was
collaborators in a very interesting recent paper (Klein- generated using the standard Metropolis algorithm to
berg et al., 2016). It is far from clear how to make al- generate a Markov Chain. The full dataset consist of
gorithms fair for all people involved. This is even more 16 × 10000 samples of 40 × 40 spin configurations (i.e.
true with methods like Deep Learning that are hard to the design matrix has 160000 samples and 1600 features)
interpret. All ML algorithms have implicit assumptions drawn at temperatures 0.25, 0.5, · · · 4.0. The samples
and choices reflected in the datasets we use to the kind are drawn for the Boltzmann distribution of the two-
of functions we choose to optimize. It is important to dimensional ferromagnetic Ising model on a 40×40 square
remember that there is no “ view from nowhere” (Adam, lattice with periodic boundary conditions.
2006; Katz, 2017) – all ML algorithms reflect a point of
view and a set of assumptions about the world we live
in. For this reason, we hope that ML practitioners and 2. SUSY dataset
data scientists will take the time to consider the social
consequences of their actions. For example, developing a The SUSY dataset was generated by Baldi et al (Baldi
Hippocratic Oath for data scientists is now being consid- et al., 2014) to explore the efficacy of using Deep Learning
ered (Simonite, 2018). Doing no harm seems like a good for classifying collision events. The dataset is download-
start for making sure that we harness ML for the benefit able from the UCI Machine Learning Repository, a won-
of all members of society. derful resource for interesting datasets. Here we quote
directly from the paper:
quantities of the final state particles, for ex- 20x20 pixel box while preserving their aspect
ample having one or more leptons with large ratio. The resulting images contain grey lev-
amounts of momentum that is transverse to els as a result of the anti-aliasing technique
the beam line ( pT ). Here instead we will used by the normalization algorithm. the im-
use logistic regression in order to attempt to ages were centered in a 28x28 image by com-
find out the relative probability that an event puting the center of mass of the pixels, and
is from a signal or a background event and translating the image so as to position this
rather than using the kinematic quantities of point at the center of the 28x28 field.
final state particles directly we will use the
output of our logistic regression to define a The MNIST is often included by default in many modern
part of phase space that is enriched in sig- ML packages.
nal events. The dataset we are using has the
value of 18 kinematic variables ("features") of
the event. The first 8 features are direct mea- REFERENCES
surements of final state particles, in this case
the pT , pseudo-rapidity, and azimuthal angle Abu-Mostafa, Yaser S, Malik Magdon-Ismail, and Hsuan-
of two leptons in the event and the amount Tien Lin (2012), Learning from data, Vol. 4 (AMLBook
of missing transverse momentum (MET) to- New York, NY, USA:).
Ackley, David H, Geoffrey E Hinton, and Terrence J Se-
gether with its azimuthal angle. The last ten
jnowski (1987), “A learning algorithm for boltzmann ma-
features are functions of the first 8 features; chines,” in Readings in Computer Vision (Elsevier) pp.
these are high-level features derived by physi- 522–533.
cists to help discriminate between the two Adam, Alison (2006), Artificial knowing: Gender and the
classes. You can think of them as physicists thinking machine (Routledge).
attempt to use non-linear functions to classify Advani, Madhu, and Surya Ganguli (2016), “Statistical me-
signal and background events and they have chanics of optimal convex inference in high dimensions,”
Physical Review X 6 (3), 031034.
been developed with a lot of deep thinking Advani, Madhu, Subhaneil Lahiri, and Surya Ganguli (2013),
on the part of physicist. There is however, “Statistical mechanics of complex neural systems and high
an interest in using deep learning methods to dimensional data,” Journal of Statistical Mechanics: The-
obviate the need for physicists to manually ory and Experiment 2013 (03), P03014.
develop such features. Benchmark results us- Advani, Madhu S, and Andrew M Saxe (2017), “High-
ing Bayesian Decision Trees from a standard dimensional dynamics of generalization error in neural net-
physics package and 5-layer neural networks works,” arXiv preprint arXiv:1710.03667.
Aitchison, Laurence, Nicola Corradi, and Peter E Latham
and the dropout algorithm are presented in
(2016), “Zipfs law arises naturally when there are under-
the original paper to compare the ability of lying, unobserved variables,” PLoS computational biology
deep-learning to bypass the need of using such 12 (12), e1005110.
high level features. We will also explore this Albarran-Arriagada, F, J. C. Retamal, E. Solano, and
topic in later notebooks. The dataset con- L. Lamata (2018), “Measurement-based adapta-
sists of 5 million events, the first 4,500,000 of tion protocol with quantum reinforcement learning,”
which we will use for training the model and arXiv:1803.05340 .
Alemi, Alexander A, Ian Fischer, Joshua V Dillon, and Kevin
the last 500,000 examples will be used as a
Murphy (2016), “Deep variational information bottleneck,”
test set. arXiv preprint arXiv:1612.00410.
Alemi, Alireza, and Alia Abbara (2017), “Exponential capac-
ity in an autoencoder neural network with a hidden layer,”
3. MNIST Dataset arXiv preprint arXiv:1705.07441 .
Amit, Daniel J (1992), Modeling brain function: The world of
The MNIST dataset is one of the simplest and most attractor neural networks (Cambridge university press).
widely used Machine Learning Datasets. The MNIST Amit, Daniel J, Hanoch Gutfreund, and Haim Sompolinsky
dataset consists of hand-written images of numerical (1985), “Spin-glass models of neural networks,” Physical
Review A 32 (2), 1007.
characters 0−9 and consists of a training set of 60,000 ex-
Andrieu, Christophe, Nando De Freitas, Arnaud Doucet, and
amples, and a test set of 10,000 examples (LeCun et al., Michael I Jordan (2003), “An introduction to mcmc for
1998a). Information about the MNIST database and its machine learning,” Machine learning 50 (1-2), 5–43.
historical importance can be found at Yann Lecun’s wed- Arai, Shunta, Masayuki Ohzeki, and Kazuyuki Tanaka
site: http://yann.lecun.com/exdb/mnist/. A brief (2017), “Deep neural network detects quantum phase tran-
description from the website: sition,” arXiv preprint arXiv:1712.00371 .
Arimoto, Suguru (1972), “An algorithm for computing the
The original black and white (bilevel) images capacity of arbitrary discrete memoryless channels,” IEEE
from NIST were size normalized to fit in a Transactions on Information Theory 18 (1), 14–20.
108
Arsenault, Louis-François, Alejandro Lopez-Bezanilla, Bengio, Yoshua (2012), “Practical recommendations for
O Anatole von Lilienfeld, and Andrew J Millis (2014), gradient-based training of deep architectures,” in Neural
“Machine learning for many-body physics: the case of the networks: Tricks of the trade (Springer) pp. 437–478.
anderson impurity model,” Physical Review B 90 (15), Bennett, Robert (1969), “The intrinsic dimensionality of sig-
155136. nal collections,” IEEE Transactions on Information Theory
Arunachalam, Srinivasan, and Ronald de Wolf (2017), 15 (5), 517–525.
“A survey of quantum learning theory,” arXiv preprint Bény, Cédric (2018), “Inferring relevant features: from qft to
arXiv:1701.06806 . pca,” arXiv preprint arXiv:1802.05756 .
August, Moritz, and José Miguel Hernández-Lobato (2018), Berger, James O, and José M Bernardo (1992), “On the devel-
“Taking gradients through experiments: Lstms and mem- opment of the reference prior method,” Bayesian statistics
ory proximal policy optimization for black-box quantum 4, 35–60.
control,” arXiv:1802.04063. Bickel, Peter J, and David A Freedman (1981), “Some asymp-
Aurisano, A, A Radovic, D Rocco, A Himmel, MD Messier, totic theory for the bootstrap,” The Annals of Statistics ,
E Niner, G Pawloski, F Psihas, A Sousa, and P Vahle 1196–1217.
(2016), “A convolutional neural network neutrino event Bickel, Peter J, Bo Li, Alexandre B Tsybakov, Sara A van de
classifier,” Journal of Instrumentation 11 (09), P09001. Geer, Bin Yu, Teófilo Valdés, Carlos Rivero, Jianqing Fan,
Baireuther, P, TE O’Brien, B Tarasinski, and CWJ and Aad van der Vaart (2006), “Regularization in statis-
Beenakker (2017), “Machine-learning-assisted correction tics,” Test 15 (2), 271–344.
of correlated qubit errors in a topological code,” arXiv Bishop, C M (2006), Pattern recognition and machine learning
preprint arXiv:1705.07855 . (springer).
Baity-Jesi, M, L. Sagun, M. Geiger, S. Spigler, G. Ben Arous, Bishop, Chris M (1995a), “Training with noise is equivalent to
C. Cammarota, Y. LeCun, M. Wyart, and G. Biroli (2018), tikhonov regularization,” Neural computation 7 (1), 108–
“Comparing dynamics: Deep neural networks versus glassy 116.
systems,” . Bishop, Christopher M (1995b), Neural networks for pattern
Baldassi, Carlo, Federica Gerace, Hilbert J Kappen, Carlo recognition (Oxford university press).
Lucibello, Luca Saglietti, Enzo Tartaglione, and Riccardo Blahut, Richard (1972), “Computation of channel capacity
Zecchina (2017), “On the role of synaptic stochasticity and rate-distortion functions,” IEEE transactions on Infor-
in training low-precision neural networks,” arXiv preprint mation Theory 18 (4), 460–473.
arXiv:1710.09825 . Bottou, Léon (2012), “Stochastic gradient descent tricks,” in
Baldassi, Carlo, Federica Gerace, Luca Saglietti, and Ric- Neural networks: Tricks of the trade (Springer) pp. 421–
cardo Zecchina (2018), “From inverse problems to learning: 436.
a statistical mechanics approach,” in Journal of Physics: Bowman, Samuel R, Luke Vilnis, Oriol Vinyals, Andrew M
Conference Series, Vol. 955 (IOP Publishing) p. 012001. Dai, Rafal Jozefowicz, and Samy Bengio (2015), “Gener-
Baldi, Pierre, Peter Sadowski, and Daniel Whiteson (2014), ating sentences from a continuous space,” arXiv preprint
“Searching for exotic particles in high-energy physics with arXiv:1511.06349.
deep learning,” Nature communications 5, 4308. Boyd, Stephen, and Lieven Vandenberghe (2004), Convex
Barber, David (2012), Bayesian reasoning and machine learn- optimization (Cambridge university press).
ing (Cambridge University Press). Bradde, Serena, and William Bialek (2017), “Pca meets rg,”
Barnes, Josh, and Piet Hut (1986), “A hierarchical o (n log Journal of Statistical Physics 167 (3-4), 462–475.
n) force-calculation algorithm,” nature 324 (6096), 446. Breiman, Leo (1996), “Bagging predictors,” Machine learning
Barra, Adriano, Alberto Bernacchia, Enrica Santucci, and 24 (2), 123–140.
Pierluigi Contucci (2012), “On the equivalence of hopfield Breiman, Leo (2001), “Random forests,” Machine learning
networks and boltzmann machines,” Neural Networks 34, 45 (1), 5–32.
1–9. Breuckmann, Nikolas P, and Xiaotong Ni (2017), “Scalable
Barra, Adriano, Giuseppe Genovese, Peter Sollich, and neural network decoders for higher dimensional quantum
Daniele Tantari (2016), “Phase transitions in restricted codes,” arXiv preprint arXiv:1710.09489 .
boltzmann machines with generic priors,” arXiv preprint Broecker, Peter, Fakher F Assaad, and Simon Trebst (2017),
arXiv:1612.03132 . “Quantum phase recognition via unsupervised machine
Barra, Adriano, Giuseppe Genovese, Daniele Tantari, and Pe- learning,” arXiv preprint arXiv:1707.00663 .
ter Sollich (2017), “Phase diagram of restricted boltzmann Bromley, Thomas R, and Patrick Rebentrost (2018),
machines and generalised hopfield networks with arbitrary “Batched quantum state exponentiation and quantum heb-
priors,” arXiv preprint arXiv:1702.05882 . bian learning,” arXiv:1803.07039 .
Battiti, Roberto (1992), “First-and second-order methods for Bukov, Marin (2018), “Reinforcement learning for au-
learning: between steepest descent and newton’s method,” tonomous preparation of floquet-engineered states: Invert-
Neural computation 4 (2), 141–166. ing the quantum kapitza oscillator,” Phys. Rev. B 98,
Benedetti, Marcello, John Realpe-Gómez, Rupak Biswas, 224305.
and Alejandro Perdomo-Ortiz (2016), “Quantum-assisted Bukov, Marin, Alexandre G. R. Day, Dries Sels, Phillip Wein-
learning of graphical models with arbitrary pairwise con- berg, Anatoli Polkovnikov, and Pankaj Mehta (2018), “Re-
nectivity,” arXiv preprint arXiv:1609.02542 . inforcement learning in different phases of quantum con-
Benedetti, Marcello, John Realpe-Gómez, and Alejandro trol,” Phys. Rev. X 8, 031086.
Perdomo-Ortiz (2017), “Quantum-assisted helmholtz ma- Burges, Christopher JC (1998), “A tutorial on support vector
chines: A quantum-classical deep learning framework for machines for pattern recognition,” Data mining and knowl-
industrial datasets in near-term devices,” arXiv preprint edge discovery 2 (2), 121–167.
arXiv:1708.09784 . Caio, Marcello D, Marco Caccin, Paul Baireuther, Timo
109
Hyart, and Michel Fruchart (2019), “Machine learning as- the expressive power of deep learning: A tensor analysis,”
sisted measurement of local topological invariants,” arXiv in Conference on Learning Theory, pp. 698–728.
preprint arXiv:1901.03346 . Colabrese, Simona, Kristian Gustavsson, Antonio Celani,
Caldeira, J, WLK Wu, B Nord, C Avestruz, S Trivedi, and and Luca Biferale (2017), “Flow navigation by smart mi-
KT Story (2018), “Deepcmb: Lensing reconstruction of the croswimmers via reinforcement learning,” Physical review
cosmic microwave background with deep neural networks,” letters 118 (15), 158004.
arXiv preprint arXiv:1810.01483 . Cossu, Guido, Luigi Del Debbio, Tommaso Giani, Ava Kham-
Canabarro, Askery, Samuraí Brito, and Rafael Chaves (2018), seh, and Michael Wilson (2018), “Machine learning deter-
“Machine learning non-local correlations,” arXiv preprint mination of dynamical parameters: The ising model case,”
arXiv:1808.07069 . arXiv preprint arXiv:1810.11503 .
Cárdenas-López, FA, L Lamata, JC Retamal, and E Solano Cox, Trevor F, and Michael AA Cox (2000), Multidimen-
(2017), “Generalized quantum reinforcement learning with sional scaling (CRC press).
quantum technologies,” arXiv preprint arXiv:1709.07848 . Cristoforetti, Marco, Giuseppe Jurman, Andrea I Nardelli,
Carleo, Giuseppe (2018), , Private Communication. and Cesare Furlanello (2017), “Towards meaningful physics
Carleo, Giuseppe, Yusuke Nomura, and Masatoshi Imada from generative models,” arXiv preprint arXiv:1705.09524
(2018), “Constructing exact representations of quantum .
many-body systems with deep neural networks,” arXiv Dahl, George, Abdel-rahman Mohamed, Geoffrey E Hinton,
preprint arXiv:1802.09558 . et al. (2010), “Phone recognition with the mean-covariance
Carleo, Giuseppe, and Matthias Troyer (2017), “Solving the restricted boltzmann machine,” in Advances in neural in-
quantum many-body problem with artificial neural net- formation processing systems, pp. 469–477.
works,” Science 355 (6325), 602–606. Daskin, Ammar (2018), “A quantum implementation model
Carrasquilla, Juan, and Roger G Melko (2017), “Machine for artificial neural networks,” Quanta , 7–18.
learning phases of matter,” Nature Physics 13 (5), 431. Davaasuren, Amarsanaa, Yasunari Suzuki, Keisuke Fujii,
Carrasquilla, Juan, Giacomo Torlai, Roger G Melko, and Le- and Masato Koashi (2018), “General framework for con-
andro Aolita (2018), “Reconstructing quantum states with structing fast and near-optimal machine-learning-based de-
generative models,” arXiv preprint arXiv:1810.10584 . coder of the topological stabilizer codes,” arXiv preprint
Chalk, Matthew, Olivier Marre, and Gasper Tkacik (2016), arXiv:1801.04377 .
“Relevant sparse codes with variational information bottle- Day, Alexandre GR, Marin Bukov, Phillip Weinberg, Pankaj
neck,” in Advances in Neural Information Processing Sys- Mehta, and Dries Sels (2019), “Glassy phase of opti-
tems, pp. 1957–1965. mal quantum control,” Physical Review Letters 122 (2),
Chamberland, Christopher, and Pooya Ronagh (2018), “Deep 020601.
neural decoders for near term fault-tolerant experiments,” Day, Alexandre GR, and Pankaj Mehta (2018), “Validated
arXiv preprint arXiv:1802.06441 . agglomerative clustering,” in preparation.
Chechik, Gal, Amir Globerson, Naftali Tishby, and Yair Decelle, Aurélien, Giancarlo Fissore, and Cyril Furtlehner
Weiss (2005), “Information bottleneck for gaussian vari- (2017), “Spectral learning of restricted boltzmann ma-
ables,” Journal of machine learning research 6 (Jan), 165– chines,” arXiv preprint arXiv:1708.02917 .
188. Decelle, Aurélien, Giancarlo Fissore, and Cyril Furtlehner
Chen, Chunlin, Daoyi Dong, Han-Xiong Li, Jian Chu, and (2018), “Thermodynamics of restricted boltzmann ma-
Tzyh-Jong Tarn (2014), “Fidelity-based probabilistic q- chines and related learning dynamics,” arXiv preprint
learning for control of quantum systems,” IEEE transac- arXiv:1803.01960 .
tions on neural networks and learning systems 25 (5), 920– Dempster, Arthur P, Nan M Laird, and Donald B Rubin
933. (1977), “Maximum likelihood from incomplete data via the
Chen, Jing, Song Cheng, Haidong Xie, Lei Wang, and Tao Xi- em algorithm,” Journal of the royal statistical society. Series
ang (2018), “Equivalence of restricted boltzmann machines B (methodological) , 1–38.
and tensor network states,” Phys. Rev. B 97, 085104. Deng, Dong-Ling, Xiaopeng Li, and S Das Sarma (2017),
Chen, Jun-Jie, and Ming Xue (2019), “Manipulation of spin “Quantum entanglement in neural network states,” Physi-
dynamics by deep reinforcement learning agent,” arXiv cal Review X 7 (2), 021021.
preprint arXiv:1901.08748 . Dietterich, Thomas G, et al. (2000), “Ensemble methods in
Chen, Tianqi, and Carlos Guestrin (2016), “Xgboost: A scal- machine learning,” Multiple classifier systems 1857, 1–15.
able tree boosting system,” in Proceedings of the 22nd acm Do, Chuong B, and Serafim Batzoglou (2008), “What is the
sigkdd international conference on knowledge discovery and expectation maximization algorithm?” Nature biotechnol-
data mining (ACM) pp. 785–794. ogy 26 (8), 897–899.
Cheng, Song, Jing Chen, and Lei Wang (2017), “Information Domingos, Pedro (2012), “A few useful things to know about
perspective to probabilistic modeling: Boltzmann machines machine learning,” Communications of the ACM 55 (10),
versus born machines,” arXiv preprint arXiv:1712.04144 . 78–87.
Ch’ng, Kelvin, Nick Vazquez, and Ehsan Khatami Donoho, David L (2006), “Compressed sensing,” IEEE Trans-
(2017), “Unsupervised machine learning account of mag- actions on information theory 52 (4), 1289–1306.
netic transitions in the hubbard model,” arXiv preprint Dreyfus, Hubert L (1965), “Alchemy and artificial intelli-
arXiv:1708.03350 . gence,”.
Ciliberto, Carlo, Mark Herbster, Alessandro Davide Ialongo, Du, Simon S, Chi Jin, Jason D Lee, Michael I Jordan, Aarti
Massimiliano Pontil, Andrea Rocchetto, Simone Severini, Singh, and Barnabas Poczos (2017), “Gradient descent can
and Leonard Wossnig (2017), “Quantum machine learning: take exponential time to escape saddle points,” in Advances
a classical perspective,” . in Neural Information Processing Systems, pp. 1067–1077.
Cohen, Nadav, Or Sharir, and Amnon Shashua (2016), “On Duchi, John, Elad Hazan, and Yoram Singer (2011), “Adap-
110
tive subgradient methods for online learning and stochas- (2001), The elements of statistical learning, Vol. 1 (Springer
tic optimization,” Journal of Machine Learning Research series in statistics New York).
12 (Jul), 2121–2159. Friedman, Jerome H (2001), “Greedy function approximation:
Dunjko, Vedran, and Hans J Briegel (2017), “Machine learn- a gradient boosting machine,” Annals of statistics , 1189–
ing and artificial intelligence in the quantum domain,” 1232.
arXiv preprint arXiv:1709.02779 . Friedman, Jerome H (2002), “Stochastic gradient boosting,”
Dunjko, Vedran, Yi-Kai Liu, Xingyao Wu, and Jacob M Computational Statistics & Data Analysis 38 (4), 367–378.
Taylor (2017), “Super-polynomial and exponential im- Friedman, Jerome H, Bogdan E Popescu, et al. (2003), “Im-
provements for quantum-enhanced reinforcement learning,” portance sampled learning ensembles,” Journal of Machine
arXiv preprint arXiv:1710.11160 . Learning Research 94305.
Efron, B (1979), “Bootstrap methods: another look at the Fu, Michael C (2006), “Gradient estimation,” Handbooks in
jackknife annals of statistics 7: 1–26,” View Article Pub- operations research and management science 13, 575–616.
Med/NCBI Google Scholar. Funai, Shotaro Shiba, and Dimitrios Giataganas (2018),
Efron, Bradley, Trevor Hastie, Iain Johnstone, Robert Tib- “Thermodynamics and feature extraction by machine learn-
shirani, et al. (2004), “Least angle regression,” The Annals ing,” arXiv preprint arXiv:1810.08179 .
of statistics 32 (2), 407–499. Gao, Jun, Lu-Feng Qiao, Zhi-Qiang Jiao, Yue-Chi Ma, Cheng-
Eisen, Michael B, Paul T Spellman, Patrick O Brown, and Qiu Hu, Ruo-Jing Ren, Ai-Lin Yang, Hao Tang, Man-Hong
David Botstein (1998), “Cluster analysis and display of Yung, and Xian-Min Jin (2017), “Experimental machine
genome-wide expression patterns,” Proceedings of the Na- learning of quantum states with partial information,” arXiv
tional Academy of Sciences 95 (25), 14863–14868. preprint arXiv:1712.00456 .
Elith, Jane, Steven J Phillips, Trevor Hastie, Miroslav Dudík, Gao, Xun, and Lu-Ming Duan (2017), “Efficient representa-
Yung En Chee, and Colin J Yates (2011), “A statistical tion of quantum many-body states with deep neural net-
explanation of maxent for ecologists,” Diversity and distri- works,” arXiv preprint arXiv:1701.05039 .
butions 17 (1), 43–57. Gelman, Andrew, John B Carlin, Hal S Stern, David B Dun-
Ernst, Oliver K, Thomas Bartol, Terrence Sejnowski, and son, Aki Vehtari, and Donald B Rubin (2014), Bayesian
Eric Mjolsness (2018), “Learning dynamic boltzmann dis- data analysis, Vol. 2 (CRC press Boca Raton, FL).
tributions as reduced models of spatial chemical kinetics,” Gersho, Allen, and Robert M Gray (2012), Vector quantiza-
arXiv preprint arXiv:1803.01063 . tion and signal compression, Vol. 159 (Springer Science &
Ester, Martin, Hans-Peter Kriegel, Jörg Sander, Xiaowei Xu, Business Media).
et al. (1996), “A density-based algorithm for discovering Geurts, Pierre, Damien Ernst, and Louis Wehenkel (2006),
clusters in large spatial databases with noise.” in Kdd, “Extremely randomized trees,” Machine learning 63 (1),
Vol. 96, pp. 226–231. 3–42.
Faddeev, Ludvig D, and Victor N Popov (1967), “Feynman Glorot, Xavier, and Yoshua Bengio (2010), “Understanding
diagrams for the yang-mills field,” Physics Letters B 25 (1), the difficulty of training deep feedforward neural networks,”
29–30. in Proceedings of the Thirteenth International Conference
Finol, David, Yan Lu, Vijay Mahadevan, and Ankit on Artificial Intelligence and Statistics, pp. 249–256.
Srivastava (2018), “Deep convolutional neural networks Goldt, Sebastian, and Udo Seifert (2017), “Thermodynamic
for eigenvalue problems in mechanics,” arXiv preprint efficiency of learning a rule in neural networks,” arXiv
arXiv:1801.05733 . preprint arXiv:1706.09713 .
Fisher, Charles K, and Pankaj Mehta (2015a), “Bayesian fea- Goodfellow, Ian (2016), “Nips 2016 tutorial: Generative ad-
ture selection for high-dimensional linear regression via the versarial networks,” arXiv preprint arXiv:1701.00160.
ising approximation with applications to genomics,” Bioin- Goodfellow, Ian, Yoshua Bengio, and Aaron
formatics 31 (11), 1754–1761. Courville (2016), Deep Learning (MIT Press)
Fisher, Charles K, and Pankaj Mehta (2015b), “Bayesian http://www.deeplearningbook.org.
feature selection with strongly regularizing priors maps to Goodfellow, Ian, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu,
the ising model,” Neural computation 27 (11), 2411–2422. David Warde-Farley, Sherjil Ozair, Aaron Courville, and
Foreman, Sam, Joel Giedt, Yannick Meurice, and Judah Yoshua Bengio (2014), “Generative adversarial nets,” in Ad-
Unmuth-Yockey (2017), “Rg inspired machine learning for vances in neural information processing systems, pp. 2672–
lattice field theory,” arXiv preprint arXiv:1710.02079 . 2680.
Fösel, Thomas, Petru Tighineanu, Talitha Weiss, and Flo- Greplova, Eliska, Christian Kraglund Andersen, and Klaus
rian Marquardt (2018), “Reinforcement learning with neu- Mølmer (2017), “Quantum parameter estimation with a
ral networks for quantum feedback,” arXiv:1802.05267 . neural network,” arXiv preprint arXiv:1711.05238 .
Freitas, Nahuel, Giovanna Morigi, and Vedran Dun- Grisafi, Andrea, David M Wilkins, Gábor Csányi, and
jko (2018), “Neural network operations and susuki- Michele Ceriotti (2017), “Symmetry-adapted machine-
trotter evolution of neural network states,” arXiv preprint learning for tensorial properties of atomistic systems,”
arXiv:1803.02118 . arXiv preprint arXiv:1709.06757 .
Freund, Yoav, Robert Schapire, and Naoki Abe (1999), “A Han, Zhao-Yu, Jun Wang, Heng Fan, Lei Wang, and Pan
short introduction to boosting,” Journal-Japanese Society Zhang (2017), “Unsupervised generative modeling using
For Artificial Intelligence 14 (771-780), 1612. matrix product states,” arXiv preprint arXiv:1709.01662 .
Freund, Yoav, and Robert E Schapire (1995), “A desicion- He, Kaiming, Xiangyu Zhang, Shaoqing Ren, and Jian Sun
theoretic generalization of on-line learning and an applica- (2015), “Delving deep into rectifiers: Surpassing human-
tion to boosting,” in European conference on computational level performance on imagenet classification,” in Proceed-
learning theory (Springer) pp. 23–37. ings of the IEEE international conference on computer vi-
Friedman, Jerome, Trevor Hastie, and Robert Tibshirani sion, pp. 1026–1034.
111
He, Kaiming, Xiangyu Zhang, Shaoqing Ren, and Jian Sun free energy differences,” Physical Review Letters 78 (14),
(2016), “Deep residual learning for image recognition,” in 2690.
Proceedings of the IEEE conference on computer vision and Jaynes, Edwin T (1957a), “Information theory and statistical
pattern recognition, pp. 770–778. mechanics,” Physical review 106 (4), 620.
Heimel, Theo, Gregor Kasieczka, Tilman Plehn, and Jen- Jaynes, Edwin T (1957b), “Information theory and statistical
nifer M Thompson (2018), “Qcd or what?” arXiv preprint mechanics. ii,” Physical review 108 (2), 171.
arXiv:1808.08979 . Jaynes, Edwin T (1968), “Prior probabilities,” IEEE Trans-
Higgins, Irina, Loic Matthey, Arka Pal, Christopher Burgess, actions on systems science and cybernetics 4 (3), 227–241.
Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Jaynes, Edwin T (1996), Probability theory: the logic of sci-
Alexander Lerchner (2016), “beta-vae: Learning basic vi- ence (Washington University St. Louis, MO).
sual concepts with a constrained variational framework,” Jaynes, Edwin T (2003), Probability theory: the logic of sci-
. ence (Cambridge university press).
Hinton, Geoffrey E (2002), “Training products of experts by Jeffreys, Harold (1946), “An invariant form for the prior prob-
minimizing contrastive divergence,” Neural computation ability in estimation problems,” Proceedings of the Royal
14 (8), 1771–1800. Society of London. Series A, Mathematical and Physical
Hinton, Geoffrey E (2012), “A practical guide to training re- Sciences , 453–461.
stricted boltzmann machines,” in Neural networks: Tricks Jin, Chi, Praneeth Netrapalli, and Michael I Jordan (2017),
of the trade (Springer) pp. 599–619. “Accelerated gradient descent escapes saddle points faster
Hinton, Geoffrey E, Simon Osindero, and Yee-Whye Teh than gradient descent,” arXiv preprint arXiv:1711.10456.
(2006), “A fast learning algorithm for deep belief nets,” Jordan, Michael (2018), “Artificial intelligence: The revolu-
Neural computation 18 (7), 1527–1554. tion hasnâĂŹt happened yet. medium,”.
Hinton, Geoffrey E, and Ruslan R Salakhutdinov (2006), “Re- Jordan, Michael I, Zoubin Ghahramani, Tommi S Jaakkola,
ducing the dimensionality of data with neural networks,” and Lawrence K Saul (1999), “An introduction to vari-
science 313 (5786), 504–507. ational methods for graphical models,” Machine learning
Ho, Tin Kam (1998), “The random subspace method for con- 37 (2), 183–233.
structing decision forests,” IEEE transactions on pattern Kalantre, Sandesh S, Justyna P Zwolak, Stephen Ragole,
analysis and machine intelligence 20 (8), 832–844. Xingyao Wu, Neil M Zimmerman, MD Stewart, and Ja-
Hopfield, John J (1982), “Neural networks and physical sys- cob M Taylor (2017), “Machine learning techniques for
tems with emergent collective computational abilities,” state recognition and auto-tuning in quantum dots,” arXiv
Proceedings of the national academy of sciences 79 (8), preprint arXiv:1712.04914 .
2554–2558. Katz, Yarden (2017), “Manufacturing an artificial intelligence
Huang, Haiping (2017a), “Mean-field theory of input dimen- revolution,” SSRN Preprint .
sionality reduction in unsupervised deep neural networks,” Kerenidis, Iordanis, and Anupam Prakash (2017), “Quan-
arXiv preprint arXiv:1710.01467 . tum gradient descent for linear systems and least squares,”
Huang, Haiping (2017b), “Statistical mechanics of unsuper- arXiv preprint arXiv:1704.04992 .
vised feature learning in a restricted boltzmann machine Keskar, Nitish Shirish, Dheevatsa Mudigere, Jorge Nocedal,
with binary synapses,” Journal of Statistical Mechanics: Mikhail Smelyanskiy, and Ping Tak Peter Tang (2016),
Theory and Experiment 2017 (5), 053302. “On large-batch training for deep learning: Generalization
Huang, Hengfeng, Bowen Xiao, Huixin Xiong, Zeming Wu, gap and sharp minima,” arXiv preprint arXiv:1609.04836.
Yadong Mu, and Huichao Song (2018), “Applications Kingma, Diederik P, and Jimmy Ba (2014), “Adam:
of deep learning to relativistic hydrodynamics,” arXiv A method for stochastic optimization,” arXiv preprint
preprint arXiv:1801.03334 . arXiv:1412.6980.
Hubbard, J (1959), “Calculation of partition functions,” Phys- Kingma, Diederik P, and Max Welling (2013),
ical Review Letters 3 (2), 77. “Auto-encoding variational bayes,” arXiv preprint
Huggins, William, Piyush Patil, Bradley Mitchell, K Birgitta arXiv:1312.6114.
Whaley, and E Miles Stoudenmire (2019), “Towards quan- Kingma, DP, et al. (2017), “Variational inference & deep
tum machine learning with tensor networks,” Quantum Sci- learning,” PhD thesis 978-94-6299-745-5.
ence and Technology 4 (2), 024001. Kleijnen, Jack PC, and Reuven Y Rubinstein (1996), “Op-
Iakovlev, I A, O. M. Sotnikov, and V. V. Mazurenko timization and sensitivity analysis of computer simulation
(2018), “Supervised learning magnetic skyrmion phases,” models by the score function method,” European Journal
arXiv:1803.06682 . of Operational Research 88 (3), 413–427.
Innocenti, Luca, Leonardo Banchi, Alessandro Ferraro, Kleinberg, Jon, Sendhil Mullainathan, and Manish Raghavan
Sougato Bose, and Mauro Paternostro (2018), “Supervised (2016), “Inherent trade-offs in the fair determination of risk
learning of time-independent hamiltonians for gate design,” scores,” arXiv preprint arXiv:1609.05807.
arXiv:1803.07119 . Koch-Janusz, Maciej, and Zohar Ringel (2017), “Mutual in-
Ioffe, Sergey, and Christian Szegedy (2015), “Batch normal- formation, neural networks and the renormalization group,”
ization: Accelerating deep network training by reducing in- arXiv preprint arXiv:1704.06279 .
ternal covariate shift,” in International Conference on Ma- Kohonen, Teuvo (1998), “The self-organizing map,” Neuro-
chine Learning, pp. 448–456. computing 21 (1-3), 1–6.
Iso, Satoshi, Shotaro Shiba, and Sumito Yokoo (2018), Kong, Qingkai, Daniel T. Trugman, Zachary E. Ross,
“Scale-invariant feature extraction of neural net- Michael J. Bianco, Brendan J. Meade, and Peter Ger-
work and renormalization group flow,” arXiv preprint stoft (2018), “Machine learning in seismology: Turn-
arXiv:1801.07172 . ing data into insights,” Seismological Research Letters
Jarzynski, Christopher (1997), “Nonequilibrium equality for 10.1785/0220180259.
112
Krastanov, Stefan, and Liang Jiang (2017), “Deep neural tion space of deep-learning machines,” arXiv preprint
network probabilistic decoder for stabilizer codes,” arXiv arXiv:1708.01422 .
preprint arXiv:1705.09334 . Li, Chian-De, Deng-Ruei Tan, and Fu-Jiun Jiang (2017),
Kriegel, Hans-Peter, Peer Kröger, and Arthur Zimek (2009), “Applications of neural networks to the studies of
“Clustering high-dimensional data: A survey on subspace phase transitions of two-dimensional potts models,” arXiv
clustering, pattern-based clustering, and correlation clus- preprint arXiv:1703.02369 .
tering,” ACM Transactions on Knowledge Discovery from Li, Richard Y, Rosa Di Felice, Remo Rohs, and Daniel A
Data (TKDD) 3 (1), 1. Lidar (2018), “Quantum annealing versus classical ma-
Krizhevsky, Alex, Ilya Sutskever, and Geoffrey E Hinton chine learning applied to a simplified computational biology
(2012), “Imagenet classification with deep convolutional problem,” npj Quantum Information 4 (1), 14.
neural networks,” in Advances in neural information pro- Li, Shuo-Hui, and Lei Wang (2018), “Neural network renor-
cessing systems, pp. 1097–1105. malization group,” arXiv preprint arXiv:1802.02840 .
Krzakala, Florent, Andre Manoel, Eric W Tramel, and Lenka Lim, Tjen-Sien, Wei-Yin Loh, and Yu-Shan Shih (2000), “A
Zdeborová (2014), “Variational free energies for compressed comparison of prediction accuracy, complexity, and train-
sensing,” in Information Theory (ISIT), 2014 IEEE Inter- ing time of thirty-three old and new classification algo-
national Symposium on (IEEE) pp. 1499–1503. rithms,” Machine learning 40 (3), 203–228.
Krzakala, Florent, Marc Mézard, François Sausset, YF Sun, Lin, Henry W, Max Tegmark, and David Rolnick (2017),
and Lenka Zdeborová (2012a), “Statistical-physics-based “Why does deep and cheap learning work so well?” Journal
reconstruction in compressed sensing,” Physical Review X of Statistical Physics 168 (6), 1223–1247.
2 (2), 021005. Linderman, G C, M. Rachh, J. G. Hoskins, S. Steiner-
Krzakala, Florent, Marc Mézard, Francois Sausset, Yifan Sun, berger, and Y. Kluger (2017), “Efficient Algorithms for
and Lenka Zdeborová (2012b), “Probabilistic reconstruc- t-distributed Stochastic Neighborhood Embedding,” ArXiv
tion in compressed sensing: algorithms, phase diagrams, e-prints arXiv:1712.09005 [cs.LG].
and threshold achieving matrices,” Journal of Statistical Liu, Zhaocheng, Sean P Rodrigues, and Wenshan Cai
Mechanics: Theory and Experiment 2012 (08), P08009. (2017), “Simulating the ising model with a deep convo-
Lake, Brenden M, Tomer D Ullman, Joshua B Tenenbaum, lutional generative adversarial network,” arXiv preprint
and Samuel J Gershman (2017), “Building machines that arXiv:1710.04987 .
learn and think like people,” Behavioral and Brain Sciences Loh, Wei-Yin (2011), “Classification and regression trees,”
40. Wiley Interdisciplinary Reviews: Data Mining and Knowl-
Lamata, Lucas (2017), “Basic protocols in quantum reinforce- edge Discovery 1 (1), 14–23.
ment learning with superconducting circuits,” Scientific Re- Louppe, Gilles (2014), “Understanding random forests: From
ports 7. theory to practice,” arXiv preprint arXiv:1407.7502.
Larsen, Bjornar, and Chinatsu Aone (1999), “Fast and effec- Lu, Sirui, Shilin Huang, Keren Li, Jun Li, Jianxin Chen,
tive text mining using linear-time document clustering,” in Dawei Lu, Zhengfeng Ji, Yi Shen, Duanlu Zhou, and
Proceedings of the fifth ACM SIGKDD international con- Bei Zeng (2017), “A separability-entanglement classifier via
ference on Knowledge discovery and data mining (ACM) machine learning,” arXiv preprint arXiv:1705.01523 .
pp. 16–22. Maaten, Laurens van der, and Geoffrey Hinton (2008), “Vi-
Le, Quoc V (2013), “Building high-level features using large sualizing data using t-sne,” Journal of machine learning re-
scale unsupervised learning,” in Acoustics, Speech and Sig- search 9 (Nov), 2579–2605.
nal Processing (ICASSP), 2013 IEEE International Con- MacKay, David JC (2003), Information theory, inference and
ference on (IEEE) pp. 8595–8598. learning algorithms (Cambridge university press).
LeCun, Yann, Yoshua Bengio, et al. (1995), “Convolutional Marsland III, Robert, Wenping Cui, and Pankaj Mehta
networks for images, speech, and time series,” The hand- (2019), “The Minimum Environmental Perturbation Prin-
book of brain theory and neural networks 3361 (10), 1995. ciple: A New Perspective on Niche Theory,” arXiv preprint
LeCun, Yann, Léon Bottou, Yoshua Bengio, and Patrick arXiv:1901.09673 .
Haffner (1998a), “Gradient-based learning applied to docu- Maskara, Nishad, Aleksander Kubica, and Tomas
ment recognition,” Proceedings of the IEEE 86 (11), 2278– Jochym-O’Connor (2018), “Advantages of versatile neural-
2324. network decoding for topological codes,” arXiv preprint
LeCun, Yann, Léon Bottou, Genevieve B Orr, and Klaus- arXiv:1802.08680 .
Robert Müller (1998b), “Efficient backprop,” in Neural net- Masson, JB, M Bailly Bechet, and Massimo Vergassola
works: Tricks of the trade (Springer) pp. 9–50. (2009), “Chasing information to search in random environ-
Lee, Jason D, Ioannis Panageas, Georgios Piliouras, Max Sim- ments,” Journal of Physics A: Mathematical and Theoret-
chowitz, Michael I Jordan, and Benjamin Recht (2017), ical 42 (43), 434009.
“First-order methods almost always avoid saddle points,” Mattingly, Henry H, Mark K Transtrum, Michael C Abbott,
arXiv preprint arXiv:1710.07406. and Benjamin B Machta (2018), “Maximizing the infor-
Lehmann, Erich L, and George Casella (2006), Theory of mation learned from finite data selects a simple model,”
point estimation (Springer Science & Business Media). Proceedings of the National Academy of Sciences 115 (8),
Lehmann, Erich L, and Joseph P Romano (2006), Testing 1760–1765.
statistical hypotheses (Springer Science & Business Media). McDermott, Drew, M Mitchell Waldrop, B Chandrasekaran,
Levine, Yoav, David Yakira, Nadav Cohen, and Amnon John McDermott, and Roger Schank (1985), “The dark
Shashua (2017), “Deep learning and quantum entangle- ages of ai: a panel discussion at aaai-84,” AI Magazine
ment: Fundamental connections with implications to net- 6 (3), 122.
work design.” arXiv preprint arXiv:1704.01552 . McInnes, Leland, John Healy, and James Melville
Li, Bo, and David Saad (2017), “Exploring the func- (2018), “UMAP: Uniform Manifold Approximation and
113
abling dark energy science with deep generative models of Xu (1998), “Density-based clustering in spatial databases:
galaxy images.” in AAAI, pp. 1488–1494. The algorithm gdbscan and its applications,” Data mining
Rebentrost, Patrick, Thomas R. Bromley, Christian Weed- and knowledge discovery 2 (2), 169–194.
brook, and Seth Lloyd (2017), “A quantum hopfield neural Saxe, Andrew M, James L McClelland, and Surya Gan-
network,” arXiv:1710.03599 . guli (2013), “Exact solutions to the nonlinear dynamics of
Rebentrost, Patrick, Maria Schuld, Francesco Petruccione, learning in deep linear neural networks,” arXiv preprint
and Seth Lloyd (2016), “Quantum gradient descent and arXiv:1312.6120.
newton’s method for constrained polynomial optimization,” Schapire, Robert E, and Yoav Freund (2012), Boosting:
arXiv preprint arXiv:1612.01789 . Foundations and algorithms (MIT press).
Reddy, Gautam, Antonio Celani, Terrence J Sejnowski, and Schindler, Frank, Nicolas Regnault, and Titus Neupert
Massimo Vergassola (2016a), “Learning to soar in turbu- (2017), “Probing many-body localization with neural net-
lent environments,” Proceedings of the National Academy works,” Phys. Rev. B 95, 245134.
of Sciences 113 (33), E4877–E4884. Schmidhuber, Jürgen (2015), “Deep learning in neural net-
Reddy, Gautam, Antonio Celani, and Massimo Vergassola works: An overview,” Neural networks 61, 85–117.
(2016b), “Infomax strategies for an optimal balance be- Schneidman, Elad, Michael J Berry II, Ronen Segev, and
tween exploration and exploitation,” Journal of Statistical William Bialek (2006), “Weak pairwise correlations imply
Physics 163 (6), 1454–1476. strongly correlated network states in a neural population,”
Rem, Benno S, Niklas Käming, Matthias Tarnowski, Luca Nature 440 (7087), 1007.
Asteria, Nick Fläschner, Christoph Becker, Klaus Seng- Schoenholz, Samuel S (2017), “Combining machine learning
stock, and Christof Weitenberg (2018), “Identifying quan- and physics to understand glassy systems,” arXiv preprint
tum phase transitions using artificial neural networks on arXiv:1709.08015 .
experimental data,” arXiv preprint arXiv:1809.05519 . Schuld, Maria, Mark Fingerhuth, and Francesco Petruc-
Rezende, Danilo Jimenez, Shakir Mohamed, and Daan cione (2017), “Implementing a distance-based classifier
Wierstra (2014), “Stochastic backpropagation and approx- with a quantum interference circuit,” arXiv preprint
imate inference in deep generative models,” arXiv preprint arXiv:1703.10793 .
arXiv:1401.4082. Schuld, Maria, and Nathan Killoran (2018), “Quantum ma-
Rocchetto, Andrea, Scott Aaronson, Simone Severini, Gon- chine learning in feature hilbert spaces,” arXiv:1803.07128
zalo Carvacho, Davide Poderini, Iris Agresti, Marco Ben- .
tivegna, and Fabio Sciarrino (2017), “Experimental learn- Schuld, Maria, and Francesco Petruccione (2017), “Quan-
ing of quantum states,” arXiv preprint arXiv:1712.00127 tum ensembles of quantum classifiers,” arXiv preprint
. arXiv:1704.02146 .
Rocchetto, Andrea, Edward Grant, Sergii Strelchuk, Schuld, Maria, Ilya Sinayskiy, and Francesco Petruccione
Giuseppe Carleo, and Simone Severini (2018), “Learn- (2015), “An introduction to quantum machine learning,”
ing hard quantum distributions with variational autoen- Contemporary Physics 56 (2), 172–185.
coders,” npj Quantum Information 4 (1), 28. Schwab, David J, Ilya Nemenman, and Pankaj Mehta (2014),
Rockafellar, Ralph Tyrell (2015), Convex analysis (Princeton Physical review letters 113 (6), 068102.
university press). Sethna, James (2006), Statistical mechanics: entropy, or-
Rodriguez, Alex, and Alessandro Laio (2014), “Clustering by der parameters, and complexity, Vol. 14 (Oxford University
fast search and find of density peaks,” Science 344 (6191), Press).
1492–1496. Shanahan, Phiala E, Daniel Trewartha, and William
Rokach, Lior, and Oded Maimon (2005), “Clustering meth- Detmold (2018), “Machine learning action parameters
ods,” in Data mining and knowledge discovery handbook in lattice quantum chromodynamics,” arXiv preprint
(Springer) pp. 321–352. arXiv:1801.05784 .
Roweis, Sam T, and Lawrence K Saul (2000), “Nonlinear Shannon, Claude E (1949), “Communication theory of secrecy
dimensionality reduction by locally linear embedding,” sci- systems,” Bell Labs Technical Journal 28 (4), 656–715.
ence 290 (5500), 2323–2326. Shen, Huitao, Junwei Liu, and Liang Fu (2018), “Self-learning
Rudelius, Tom (2018), “Learning to inflate,” arXiv preprint monte carlo with deep neural networks,” arXiv preprint
arXiv:1810.05159 . arXiv:1801.01127 .
Ruder, Sebastian (2016), “An overview of gradient descent Shinjo, Kazuya, Shigetoshi Sota, Seiji Yunoki, and
optimization algorithms,” arXiv preprint arXiv:1609.04747 Takami Tohyama (2019), “Characterization of photoex-
. cited states in the half-filled one-dimensional extended hub-
Rumelhart, David E, and David Zipser (1985), “Feature dis- bard model assisted by machine learning,” arXiv preprint
covery by competitive learning,” Cognitive science 9 (1), arXiv:1901.07900 .
75–112. Shlens, Jonathon (2014), “A tutorial on principal component
Ruscher, Céline, and Jörg Rottler (2018), “Correlations in analysis,” arXiv preprint arXiv:1404.1100.
the shear flow of athermal amorphous solids: A principal Shwartz-Ziv, Ravid, and Naftali Tishby (2017), “Opening the
component analysis,” arXiv preprint arXiv:1809.06487 . black box of deep neural networks via information,” arXiv
Saito, Hiroki, and Masaya Kato (2017), “Machine learning preprint arXiv:1703.00810.
technique to find quantum many-body ground states of Sidky, Hythem, and Jonathan K Whitmer (2017), “Learn-
bosons on a lattice,” arXiv preprint arXiv:1709.05468 . ing free energy landscapes using artificial neural networks,”
Salazar, Domingos SP (2017), “Nonequilibrium thermody- arXiv preprint arXiv:1712.02840 .
namics of restricted boltzmann machines,” arXiv preprint Simonite, Tom (2018), “Should data scientist adhere to a hip-
arXiv:1704.08724 . pocratic oath?” Wired .
Sander, Jörg, Martin Ester, Hans-Peter Kriegel, and Xiaowei Singh, Kesar (1981), “On the asymptotic accuracy of efron’s
115
bootstrap,” The Annals of Statistics , 1187–1195. Tenenbaum, Joshua B, Vin De Silva, and John C Langford
Slonim, Noam, Gurinder S Atwal, Gasper Tkacik, and (2000), “A global geometric framework for nonlinear dimen-
William Bialek (2005), “Estimating mutual information sionality reduction,” science 290 (5500), 2319–2323.
and multi–information in large networks,” arXiv preprint Tibshirani, Ryan J, et al. (2013), “The lasso problem and
cs/0502017. uniqueness,” Electronic Journal of Statistics 7, 1456–1490.
Sønderby, Casper Kaae, Tapani Raiko, Lars Maaløe, Tieleman, Tijmen, and Geoffrey Hinton (2009), “Using fast
Søren Kaae Sønderby, and Ole Winther (2016), “Ladder weights to improve persistent contrastive divergence,” in
variational autoencoders,” in Advances in neural informa- Proceedings of the 26th Annual International Conference
tion processing systems, pp. 3738–3746. on Machine Learning (ACM) pp. 1033–1040.
Springenberg, Jost Tobias, Alexey Dosovitskiy, Thomas Brox, Tieleman, Tijmen, and Geoffrey Hinton (2012), “Lecture 6.5-
and Martin Riedmiller (2014), “Striving for simplicity: The rmsprop: Divide the gradient by a running average of its
all convolutional net,” arXiv preprint arXiv:1412.6806. recent magnitude,” COURSERA: Neural networks for ma-
Sriarunothai, Theeraphot, Sabine Wölk, Gouri Shankar Giri, chine learning 4 (2), 26–31.
Nicolai Fries, Vedran Dunjko, Hans J Briegel, and Christof Tishby, Naftali, Fernando C Pereira, and William Bialek
Wunderlich (2017), “Speeding-up the decision making of a (2000), “The information bottleneck method,” arXiv
learning agent using an ion trap quantum processor,” arXiv preprint physics/0004057.
preprint arXiv:1709.01366 . Tomczak, P, and H. Puszkarski (2018), “Ferromagnetic res-
Srivastava, Nitish, Geoffrey E Hinton, Alex Krizhevsky, Ilya onance in thin films studied via cross-validation of numer-
Sutskever, and Ruslan Salakhutdinov (2014), “Dropout: a ical solutions of the smit-beljers equation: Application to
simple way to prevent neural networks from overfitting.” (ga,mn)as,” Phys. Rev. B 98, 144415.
Journal of machine learning research 15 (1), 1929–1958. Torgerson, Warren S (1958), “Theory and methods of scaling.”
Stoudenmire, E Miles (2018), “Learning relevant features .
of data with multi-scale tensor networks,” arXiv preprint Torlai, Giacomo, Guglielmo Mazzola, Juan Carrasquilla,
arXiv:1801.00315 . Matthias Troyer, Roger Melko, and Giuseppe Carleo
Stoudenmire, E Miles, and David J Schwab (2016), “Super- (2018), “Neural-network quantum state tomography,” Na-
vised learning with tensor networks,” in Advances in Neural ture Physics 14 (5), 447.
Information Processing Systems, pp. 4799–4807. Torlai, Giacomo, and Roger G. Melko (2017), “Neural de-
Stoudenmire, EM, and Steven R White (2012), “Studying coder for topological codes,” Phys. Rev. Lett. 119, 030501.
two-dimensional systems with the density matrix renormal- Tramel, Eric W, Marylou Gabrié, Andre Manoel, Francesco
ization group,” Annu. Rev. Condens. Matter Phys. 3 (1), Caltagirone, and Florent Krzakala (2017), “A determin-
111–128. istic and generalized framework for unsupervised learn-
Stratonovich, RL (1957), “On a method of calculating quan- ing with restricted boltzmann machines,” arXiv preprint
tum distribution functions,” in Soviet Physics Doklady, arXiv:1702.03260 .
Vol. 2, p. 416. Tubiana, Jérôme, and Rémi Monasson (2017), “Emergence
Strouse, DJ, and David J Schwab (2017), “The deterministic of compositional representations in restricted boltzmann
information bottleneck,” Neural computation 29 (6), 1611– machines,” Physical Review Letters 118 (13), 138301.
1630. Van Der Maaten, Laurens (2014), “Accelerating t-sne using
Suchsland, Philippe, and Stefan Wessel (2018), “Parameter tree-based algorithms,” The Journal of Machine Learning
diagnostics of phases and phase transition learning by neu- Research 15 (1), 3221–3245.
ral networks,” arXiv preprint arXiv:1802.09876 . Venderley, Jordan, Vedika Khemani, and Eun-Ah Kim
Sutskever, Ilya, James Martens, George Dahl, and Geoffrey (2017), “Machine learning out-of-equilibrium phases of
Hinton (2013), “On the importance of initialization and matter,” arXiv preprint arXiv:1711.00020 .
momentum in deep learning,” in International conference Vergassola, Massimo, Emmanuel Villermaux, and Boris I
on machine learning, pp. 1139–1147. Shraiman (2007), Nature 445 (7126), 406.
Sutton, Richard S, and Andrew G Barto (1998), Reinforce- Vidal, Guifre (2007), “Entanglement renormalization,” Phys-
ment learning: An introduction, Vol. 1 (MIT press Cam- ical review letters 99 (22), 220405.
bridge). Wainwright, Martin J, Michael I Jordan, et al. (2008),
Swaddle, Michael, Lyle Noakes, Liam Salter, Harry Small- “Graphical models, exponential families, and variational in-
bone, and Jingbo Wang (2017), “Generating 3 qubit ference,” Foundations and Trends® in Machine Learning
quantum circuits with neural networks,” arXiv preprint 1 (1–2), 1–305.
arXiv:1703.10743 . Wang, Ce, and Hui Zhai (2017), “Unsupervised learning stud-
Sweke, Ryan, Markus S Kesselring, Evert PL van Nieuwen- ies of frustrated classical spin models i: Principle compo-
burg, and Jens Eisert (2018), “Reinforcement learning nent analysis,” arXiv preprint arXiv:1706.07977 .
decoders for fault-tolerant quantum computation,” arXiv Wang, Ce, and Hui Zhai (2018), “Machine learning of frus-
preprint arXiv:1810.07207 . trated classical spin models. ii. kernel principal component
Székely, GJ (2003), “E-statistics: The energy of statistical analysis,” arXiv preprint arXiv:1803.01205 .
samples,” Bowling Green State University, Department of Wang, Lei (2017), “Can boltzmann machines discover cluster
Mathematics and Statistics Technical Report 3 (05), 1–18. updates?” arXiv preprint arXiv:1702.08586 .
Tanaka, Akinori, and Akio Tomiya (2017a), “Detection of Wang, Yi-Nan, and Zhibai Zhang (2018), “Learning non-
phase transition via convolutional neural networks,” Jour- higgsable gauge groups in 4d f-theory,” arXiv preprint
nal of the Physical Society of Japan 86 (6), 063001. arXiv:1804.07296 .
Tanaka, Akinori, and Akio Tomiya (2017b), “Towards reduc- Wasserman, Larry (2013), All of statistics: a concise course in
tion of autocorrelation in hmc by machine learning,” arXiv statistical inference (Springer Science & Business Media).
preprint arXiv:1712.03893 . Wattenberg, Martin, Fernanda Viégas, and Ian Johnson
116
(2016), “How to use t-sne effectively,” Distill 1 (10), e2. robust control of single-triplet qubits,” arXiv preprint
Wei, Qianshi, Roger G Melko, and Jeff ZY Chen (2017), arXiv:1708.00238 .
“Identifying polymer states by machine learning,” Physical Yedidia, Jonathan (2001), “An idiosyncratic journey beyond
Review E 95 (3), 032504. mean field theory,” Advanced mean field methods: Theory
Weigt, Martin, Robert A White, Hendrik Szurmant, James A and practice , 21–36.
Hoch, and Terence Hwa (2009), “Identification of direct Yedidia, Jonathan S, William T Freeman, and Yair Weiss
residue contacts in protein–protein interaction by message (2003), “Understanding belief propagation and its general-
passing,” Proceedings of the National Academy of Sciences izations,” Morgan Kaufmann Publishers Inc. San Francisco,
106 (1), 67–72. CA, USA .
Weinstein, Steven (2017), “Learning the einstein-podolsky- Yoshioka, Nobuyuki, Yutaka Akagi, and Hosho Katsura
rosen correlations on a restricted boltzmann machine,” (2017), “Learning disordered topological phases by statisti-
arXiv preprint arXiv:1707.03114 . cal recovery of symmetry,” arXiv preprint arXiv:1709.05790
Wetzel, Sebastian Johann (2017), “Unsupervised learning of .
phase transitions: from principle component analysis to You, Yi-Zhuang, Zhao Yang, and Xiao-Liang Qi (2017),
variational autoencoders,” arXiv preprint arXiv:1703.02435 “Machine learning spatial geometry from entanglement fea-
. tures,” arXiv preprint arXiv:1709.01223 .
Wetzel, Sebastian Johann, and Manuel Scherzer (2017), Yu, Chao-Hua, Fei Gao, and Qiao-Yan Wen (2017),
“Machine learning of explicit order parameters: From the “Quantum algorithms for ridge regression,” arXiv preprint
ising model to SU (2) lattice gauge theory,” arXiv preprint arXiv:1707.09524 .
arXiv:1705.05582 . Zdeborová, Lenka, and Florent Krzakala (2016), “Statistical
White, Steven R (1992), “Density matrix formulation for physics of inference: Thresholds and algorithms,” Advances
quantum renormalization groups,” Physical review letters in Physics 65 (5), 453–552.
69 (19), 2863. Zeiler, Matthew D (2012), “Adadelta: an adaptive learning
White, Tom (2016), “Sampling generative networks: rate method,” arXiv preprint arXiv:1212.5701.
Notes on a few effective techniques,” arXiv preprint Zhang, Chengxian, and Xin Wang (2018), “Spin-qubit noise
arXiv:1609.04468. spectroscopy from randomized benchmarking by supervised
Williams, DRGHR, and Geoffrey Hinton (1986), “Learn- learning,” arXiv preprint arXiv:1810.07914 .
ing representations by back-propagating errors,” Nature Zhang, Chiyuan, Samy Bengio, Moritz Hardt, Benjamin
323 (6088), 533–538. Recht, and Oriol Vinyals (2016), “Understanding deep
Wilson, Ashia C, Rebecca Roelofs, Mitchell Stern, Nathan learning requires rethinking generalization,” arXiv preprint
Srebro, and Benjamin Recht (2017), “The marginal value arXiv:1611.03530.
of adaptive gradient methods in machine learning,” arXiv Zhang, Pengfei, Huitao Shen, and Hui Zhai (2017a), “Ma-
preprint arXiv:1705.08292. chine learning topological invariants with neural networks,”
Wilson, Kenneth G, and John Kogut (1974), “The renormal- arXiv preprint arXiv:1708.09401 .
ization group and the epsilon expansion,” Physics Reports Zhang, Xiao-Ming, Zi-Wei Cui, Xin Wang, and Man-Hong
12 (2), 75–199. Yung (2018), “Automatic spin-chain learning to explore the
Witte, RS, and J.S. Witte (2013), Statistics (Wiley). quantum speed limit,” arXiv preprint arXiv:1802.09248 .
Wu, Yadong, Pengfei Zhang, Huitao Shen, and Hui Zhai Zhang, Yi, Roger G Melko, and Eun-Ah Kim (2017b), “Ma-
(2018), “Visualizing neural network developing perturba- chine learning Z2 quantum spin liquids with quasi-particle
tion theory,” arXiv preprint arXiv:1802.03930 . statistics,” arXiv preprint arXiv:1705.01947 .
Xie, Junyuan, Ross Girshick, and Ali Farhadi (2016), “Un- Zimek, Arthur, Erich Schubert, and Hans-Peter Kriegel
supervised deep embedding for clustering analysis,” in In- (2012), “A survey on unsupervised outlier detection in high-
ternational conference on machine learning, pp. 478–487. dimensional numerical data,” Statistical Analysis and Data
Yang, Tynia, Jinze Liu, Leonard McMillan, and Wei Wang Mining: The ASA Data Science Journal 5 (5), 363–387.
(2006), “A fast approximation to multidimensional scaling,” Zou, Hui, and Trevor Hastie (2005), “Regularization and vari-
in IEEE workshop on Computation Intensive Methods for able selection via the elastic net,” Journal of the Royal Sta-
Computer Vision. tistical Society: Series B (Statistical Methodology) 67 (2),
Yang, Xu-Chen, Man-Hong Yung, and Xin Wang 301–320.
(2017), “Neural network designed pulse sequences for