Machine Learning Algorithms in Depth MEAP V01 Vadim Smolyakov 2024 Scribd Download
Machine Learning Algorithms in Depth MEAP V01 Vadim Smolyakov 2024 Scribd Download
com
https://ebookmeta.com/product/machine-learning-algorithms-
in-depth-meap-v01-vadim-smolyakov/
OR CLICK HERE
DOWLOAD NOW
https://ebookmeta.com/product/terraform-in-depth-meap-v01-robert-
hafner/
ebookmeta.com
https://ebookmeta.com/product/css-in-depth-second-edition-
meap-v01-keith-grant/
ebookmeta.com
https://ebookmeta.com/product/django-in-action-meap-v01-christopher-
trudeau/
ebookmeta.com
https://ebookmeta.com/product/fire-safety-law-1st-edition-v-charles-
ward/
ebookmeta.com
Berlitz Pocket Guide Sri Lanka Travel Guide eBook 4th
Edition Berlitz
https://ebookmeta.com/product/berlitz-pocket-guide-sri-lanka-travel-
guide-ebook-4th-edition-berlitz/
ebookmeta.com
https://ebookmeta.com/product/from-sunlight-to-electricity-a-
practical-handbook-on-solar-photovoltaic-applications-3rd-edition-
suneel-deambi/
ebookmeta.com
https://ebookmeta.com/product/wild-at-the-library-a-curvy-woman-
romance-1st-edition-liz-fox/
ebookmeta.com
https://ebookmeta.com/product/a-dictionary-of-theatre-anthropology-
the-secret-art-of-the-performer-2nd-edition-eugenio-barba/
ebookmeta.com
Understanding Virtual Reality Interface Application and
Design Second Edition William R. Sherman
https://ebookmeta.com/product/understanding-virtual-reality-interface-
application-and-design-second-edition-william-r-sherman/
ebookmeta.com
Machine Learning Algorithms in Depth MEAP V01
1. Copyright_2022_Manning_Publications
2. welcome
3. 1_Machine_Learning_Algorithms
4. 2_Markov_Chain_Monte_Carlo
5. 3_Variational_Inference
6. 4_Software_Implementation
MEAP Edition
Version 1
manning.com
welcome
Thank you for purchasing the MEAP for Machine Learning Algorithms in
Depth. This book will take you on a journey from mathematical derivation to
software implementation of some of the most intriguing algorithms in ML.
This book dives into the design of ML algorithms from scratch. Throughout
the book, you will develop mathematical intuition for classic and modern ML
algorithms, learn the fundamentals of Bayesian inference and deep learning,
as well as the data structures and algorithmic paradigms in ML.
Understanding ML algorithms from scratch will help you choose the right
algorithm for the task, explain the results, troubleshoot advanced problems,
extend an algorithm to a new application, and improve performance of
existing algorithms.
Some of the prerequisites for reading this book include basic level of
programming in Python and intermediate level of understanding of linear
algebra, applied probability and multivariate calculus.
Thank you again for your interest and welcome to the world of ML
algorithms!
— Vadim Smolyakov
In this book
Two popular questions to ask about an algorithm is how fast does it run (run-
time complexity) and how much memory does it take (memory complexity)
for an input of size n. For example, a comparison-based sort, as we’ll see
later, has O(nlogn) run-time complexity and requires O(n) memory storage.
There are many approaches to sorting, and in each case, in the classic
algorithmic paradigm, the algorithm designer creates a set of instructions.
Imagine a world where you can learn the instructions based on a sequence of
input and output examples available to you. This is a setting of ML
algorithmic paradigm. Similar to how a human brain learns, when we are
playing connect-the-dots game or sketching a nature landscape, we are
comparing the desired output with what we have at each step and filling in
the gaps. This in broad strokes is what (supervised) machine learning (ML)
algorithms do. During training, ML algorithms are learning the rules (e.g.
classification boundaries) based on training examples by optimizing an
objective function. During testing, ML algorithms apply previously learned
rules to new input data points to give a prediction as shown in Figure 1.1
1.1 Types of ML Algorithms
Let’s unpack the previous paragraph a little bit and introduce some notation.
This book focuses on machine learning algorithms that can be grouped
together in the following categories: supervised learning, unsupervised
learning and deep learning. In supervised learning, the task is to learn a
mapping f from inputs x to outputs given a training dataset D = {(x1,y1 ),…,
(xn,yn )} of n input-output pairs. In other words, we are given n examples of
what the output should look like given the input. The output y is also often
referred to as the label, and it is the supervisory signal that tells our algorithm
what the correct answer is.
Thus, the nature of the problem changes based on the quantity y we are trying
to predict. We want to get as close as possible to the ground truth value of y.
A common way to measure performance or closeness to ground truth is the
loss function. The loss function is computing a distance between the
prediction and the true label. Let y = f(x; θ) be our ML algorithm that
maps input examples x to output labels y, parameterized by θ, where θ
captures all the learnable parameters of our ML algorithm. Then, we can
write our classification loss function as follows in Equation 1.1:
Essentially, we are subtracting our prediction from the ground truth label,
squaring it and aggregating the result as an average over all data points. By
taking the square we are eliminating the possibility of negative loss values,
which would impact our summation.
In unsupervised learning, we are not given the label y nor are we learning
the mapping between input and output examples, instead we are interested in
making sense of the data itself. Usually, that implies in a lower dimension
and with some properties so it could be easier to understand by human. In
other words, our training dataset consists of D = {x1,…,xn} of n input
examples without any corresponding labels y. The simplest example of
unsupervised learning is finding clusters within data. Intuitively, data points
that belong to the same cluster have similar characteristics. In fact, data
points within a cluster can be represented by the cluster center as an exemplar
and used as part of a data compression algorithm. Alternatively, we can look
at the distances between clusters in a projected lower-dimensional space to
understand the inter-relation between different groups. Additionally, a point
that’s far away from all the existing clusters can be considered an anomaly
leading to an anomaly detection algorithm. As you can see, there’s an infinite
number of interesting uses cases that arise from unsupervised learning, and
we’ll be learning from scratch some of the most intriguing algorithms in that
space.
Figure 1.2 Unsupervised Learning: clusters of data points projected onto 2-dimensional space
Another very important area of modern machine algorithms is deep learning.
The name comes from a stack of computational layers forming together a
computational graph. The depth of this graph refers to sequential computation
and the breadth to parallel computation.
As we’ll see, deep learning models gradually refine their parameters through
back-propagation algorithm until they meet the objective function. Deep
learning models permeated the industry due to their ability to solve complex
problems with high accuracy. For example, Figure 1.3 shows a deep learning
architecture for sentiment analysis. We’ll learn more about what individual
blocks represent in future chapters.
Figure 1.3 Deep Neural Network (DNN) architecture for sentiment analysis
Deep learning is a very active research area and we’ll be focusing on the
modern deep learning algorithms throughout this book. For example, in self-
supervised learning, used in Transformer models, we are using the context
and structure of the natural language as a supervisory signal thereby
extracting the labels from the data itself. In addition to classic applications of
deep learning in Natural Language Processing (NLP) and Computer Vision
(CV), we’ll be taking a look at generative models, learning how to predict
time-series data and journey into relational graph data.
Secondly, you will be able to explain the results of the given algorithm to the
stakeholders. Being able to interpret the results and present them to the
audience in the industrial or academic settings is an important trait of ML
algorithm designer.
Thirdly, you will be able to use intuition developed by reading this book to
troubleshoot advanced ML problems. Breaking down a complex problem into
smaller pieces and understanding where things went wrong often requires a
strong sense of fundamentals and algorithmic intuition. This book will allow
the reader to construct minimum working examples and build upon existing
algorithms to develop and be able to debug more complex models.
Fourthly, you will be able to extend an algorithm when a new situation arises
in the real world, in particular, where the textbook algorithm or a library
cannot be used as is. The in-depth understanding of ML algorithms that you
will acquire in this book will help you modify existing algorithms to meet
your needs.
Figure 1.4 Bayes engine showing the transformation of a prior to a posterior as more data is
observed
Posteriors that have the same form as the prior are known as conjugate
priors, which are historically preferred since they simplify computation by
having closed form updates. The denominator Z=p(x)=∫p(x|θ)p(θ)dθ is
known as the normalizing constant or the partition function and is often
intractable to compute due to integration in high dimensional parameter
space. We’ll look at a number of techniques in this book that work around the
problem of estimating Z.
Figure 1.5 Probabilistic Graphical Model (PGM) for a Gaussian Mixture Model
Another Random Document on
Scribd Without Any Related Topics
medium, by making their experiments in a vacuum. They selected
with great 150 judgment the conditions of their experiments and
comparisons, making one quantity vary while the others remained
constant. In this manner they found, that the quickness of cooling for
a constant excess of temperature, increases in geometrical
progression, when the temperature of the surrounding space
increases in arithmetical progression; whereas, according to the
Newtonian law, this quickness would not have varied at all. Again,
this variation being left out of the account, it appeared that the
quickness of cooling, so far as it depends on the excess of
temperature of the hot body, increases as the terms of a geometrical
progression diminished by a constant number, when the temperature
of the hot body increases in arithmetical progression. These two
laws, with the coefficients requisite for their application to particular
substances, fully determine the conditions of cooling in a vacuum.
3. The heat is emitted from every point of the surface of a hot body
in all directions; but by no means in all directions with equal intensity.
The intensity of the heating ray is as the sine of the angle which it
makes with the surface.
The last law is entirely, the two former in a great measure, due to
the researches of Leslie, whose Experimental Inquiry into the Nature
and Propagation of Heat, published in 1804, contains a great
number of curious and striking results and speculations. The laws
now just 152 stated bear, in a very important manner, upon the
formation of the theory; and we must now proceed to consider what
appears to have been done in this respect; taking into account, it
must still be borne in mind, only the phenomena of conduction and
radiation.
This hypothesis is, that the radiation takes place, not from the
surface alone of the hot body, but from all particles situated within a
certain small depth of the surface. It is easy to see 22 that, on this
supposition, a ray emitted obliquely from an internal particle, will be
less intense than one sent forth perpendicular to the surface,
because the former will be intercepted in a greater degree, having a
greater length of path within the body; and Fourier shows, that
whatever be the law of this intercepting power, the result will be, that
the radiative intensity is as the sine of the angle made by the ray with
the surface.
22 Mém. Inst. t. v. 1821, p. 204.
But this law is, as I have said, likewise necessary, in order that
neighboring bodies may tend to assume the same temperature: for
instance, in order that a small particle placed within a spherical shell,
should finally assume the temperature of the shell. If the law of the
sines did not obtain, the final temperature of such a particle would
depend upon its place in the inclosure; 23 and within a shell of ice we
should have, at certain points, the temperature of boiling water and
of melting iron.
23 An. Chim. iv. 1817, p. 129.
28 Bibliothèque Universelle.
29
Ed. R. S. Transactions, vol. xiv.; and Phil. Mag. 1835, vol. v. p.
209. Ib. vol. vii. p. 349.
33 Ib. p. 272.
[2nd Ed.] Yet MM. Magnus and Regnault conceive that they have
overthrown this law of Dalton and Gay-Lussac, and shown that the
different gases do not expand alike for the same increment of heat.
Magnus found the ratio to be for atmospheric air, 1∙366; for
hydrogen, 1∙365; for carbonic acid, 1∙369; for sulphurous-acid gas,
1∙385. But these differences are not greater than the differences
obtained for the same substances by different observers; and as this
law is referred to in Laplace’s hypothesis, hereafter to be discussed,
I do not treat the law as disproved.
It was found, also, that the capacity of the same substance was
different in the same substance at different temperatures. It appears
from experiments of MM. Dulong and Petit, that, in general, the
capacity of liquids and solids increases as we ascend in the scale of
temperature.
But one of the most important thermotic facts is, that by the
sudden contraction of any mass, its temperature is increased. This is
peculiarly observable in gases, as, for example, common air. The
amount of the increase of temperature by sudden condensation, or
of the cold produced by sudden rarefaction, is an important datum,
determining the velocity of sound, as we have already seen, and
affecting many points of meteorology. The coefficient which enters
the calculation in the former case depends on the ratio of two
specific heats of air under different conditions; one belonging to it
when, varying in density, the pressure is constant by which the air is
contained; the other, when, varying in density, it is contained in a
constant space.
That snow requires a great quantity of heat to melt it; that water
requires a great quantity of heat to convert it into steam; and that this
heat is not indicated by a rise in the thermometer, are facts which it
is not difficult to observe; but to separate these from all extraneous
conditions, to group the cases together, and to seize upon the
general law by which they are connected, was an effort of inductive
insight, which has been considered, and deservedly, as one of the
most striking 161 events in the modern history of physics. Of this step
the principal merit appears to belong to Black.
[2nd Ed.] [In the first edition I had mentioned the names of De Luc
and of Wilcke, in connexion with the discovery of Latent Heat, along
with the name of Black. De Luc had observed, in 1755, that ice, in
melting, did not rise above the freezing-point of temperature till the
whole was melted. De Luc has been charged with plagiarizing
Black’s discovery, but, I think, without any just ground. In his Idées
sur la Météorologique (1787), he spoke of Dr. Black as “the first who
had attempted the determinations of the quantities of latent heat.”
And when Mr. Watt pointed out to him that from this expression it
might be supposed that Black had not discovered the fact itself, he
acquiesced, and redressed the equivocal expression in an Appendix
to the volume. 36
36 See his Letter to the Editors of the Edinburgh Review, No. xii.
p. 502, of the Review.