Free preview
146 lessons
Essential Calculus for ML
Free preview
Essential Calculus for ML · 146 lessons
No surprise gaps
Actually remember it
Skip what you know
One subscription. All learning paths included.
Our content is best on a larger screen
Level curves
To picture a surface we have so far cut it with vertical planes, holding one of the inputs, or , fixed. A horizontal plane also cuts it: the plane meets the surface wherever the height is exactly , and directly beneath that intersection, in the -plane, lies a curve.
Definition
The level curve of at level is the set of points of the -plane with .
Level curves at several levels, drawn together in the -plane and each labelled with its level, form the contour plot of . Each labelled curve on the plot is a contour.
Toggle the views below. The first view shows three horizontal planes cutting one surface, each intersection drawn again in the -plane beneath it. The second view shows those same curves on their own in the -plane, each labelled with its level.
Finding the level curve at level therefore means solving the single equation .
If no pair satisfies , then has no level curve at that level and nothing is drawn for it.
Details
The surface is cut by the horizontal planes and . Find the level curve of at each level, and describe what it looks like in the -plane.
Solution
The level curve at level is the set of points with , so at level we solve
This equation is the level curve: the curve consists of exactly the pairs satisfying it. To see what it looks like, we match it against a form we know: is the circle of radius about the origin, and here , so the level curve at is the circle of radius . Checking one of its points, , the level we set.
At level the equation is
Matching the form now asks for , and no real radius has a negative square. Nor does any point satisfy the equation, since is a sum of two squares and is never negative. There is no level curve at , and nothing is drawn for that level.
Practice questions
4 questions
Which curve is the level curve of at level ?
Select the correct answer:
+ 3 more questions
Reading a contour plot
A contour plot is a flat picture that carries everything we need to know about the shape of a surface: without ever seeing it in 3D, the labels and spacing tell us where it is high and low, where it climbs steeply, and where its peaks and basins sit.
Every point of a contour shares its label's value, so is constant along a contour, and each step across a contour changes by one label. The contour plot below shows one surface, drawn without axes: none of the readings needs a coordinate, only the labels. Step through the five readings.
The last two readings named what nested contours surround; precisely:
Definition
Nested closed contours whose levels increase towards the innermost contour surround a peak, a high point of the surface. Nested closed contours whose levels decrease towards the innermost contour surround a basin, a low point of the surface.
The steepness reading holds on any plot with equally spaced levels:
Key Point
On a plot whose levels rise in equal steps, contours packed close together mark a steep part of the surface, and contours spread far apart a shallow part.
ML Context
A model with two parameters has a loss value for every pair of settings, and those values form a surface above the plane of settings. Fitting the model, adjusting its two parameters to shrink the loss, is pictured on a contour plot of that surface.
Practice questions
4 questions
The contour plot below shows one surface, with four points marked on it. The levels rise in equal steps of .
At which of the marked points is the surface steepest?
Select the correct answer:
+ 3 more questions