Assignment 4 Contour Maps
Assignment 4 Contour Maps
Assignment 4 Contour Maps
Ans.
Contour maps are two-dimensional representations of three-dimensional landscapes
that use contour lines to represent the elevation of the land. The lines connect points
of equal elevation, creating a topographic map that can be used to interpret the
terrain. Here are some steps to help you interpret a contour map:
1. Understand the contour interval: Contour maps use a contour interval, which is the
vertical distance between each contour line. For example, if the contour interval is 10
meters, each contour line represents a change in elevation of 10 meters.
2. Identify the contour lines: Contour lines are the curved lines on the map that
represent a specific elevation. The lines that are closer together represent steeper
terrain, while lines that are farther apart represent flatter terrain.
3. Determine the direction of the slope: Contour lines that are closer together on the
top of a hill and farther apart on the bottom indicate a hill. Conversely, contour lines
that are closer together at the bottom of a valley and farther apart at the top indicate
a valley.
4. Identify the highest and lowest points: The highest point on a contour map is the
peak of a mountain or hill, where the contour lines form a closed circle around a high
point. The lowest point is typically a depression, such as a basin or valley, where the
contour lines form a closed circle around a low point.
5. Evaluate the terrain: By interpreting the contour map, you can gain a better
understanding of the terrain, such as its steepness, the presence of ridges or valleys,
and the locations of peaks and depressions. This information can be useful for a
variety of purposes, such as planning hiking or camping trips or designing
infrastructure projects like roads or pipelines.
Overall, interpreting contour maps requires some practice and familiarity with the
terrain, but with these basic steps, you can begin to understand the elevation and
features of the landscape represented by the map.
Let’s assume that my 3D Error surface looks like this from the front view,
The graph's x-axis shows the interaction between the two parameters w and b, which
are each represented by a single parameter called theta, while the y-axis shows the
error value. Imagine cutting this mistake surface into horizontal slices along the
vertical axis. The space between the two ellipses is not equal, as can be seen if you
look at the error surface from the top. The distance is greater on the left side and
smaller on the right. This is because the error surface's region with the steepest slope
corresponds to the area with the shortest distance between the two ellipses
highlighted in red.
Every angled line you see in the contour plot represents one cut along the vertical
axis that means the error (loss value) is the same along the line. If you look at the
contour present at the extreme left side of the plot (marked with yellow in the below
figure) there are no other boundaries or contour surfaces towards the left side in
contrast to the right side where you can see a cluster of contour surfaces very close
to each other.
Contour Extremes
As there are no contours present on the left side I can say that the distance between
the two contours (contour marked with yellow and some other contour located far
away towards the left, if present) is very large because I can’t see any contour in the
vicinity. If the distance between the contours is large that means the slope in this area
is very gentle so this area in the 3D plot will be a flat region.
It is going to be a high flat region because the color is red that indicates the error
value in this area will be high. Similarly, if we look at the contour present at the right
extreme of the plot (marked with black in the below figure) there are no boundaries
towards the right side that means the slope in this area is also very gentle and it will
be a flat region, it will be a low flat region because the color in this region is blue that
indicates the error value in this area will be low
We started from the high flat surface (dark red) and the loss value was constant for a long
time because the surface is flat. We are transitioning very rapidly from the dark red region to
the dark blue region because the slopes were very steep in this region. This is how we
interpret the contour maps and imagine how the 3D surface would look like from the
corresponding 2D surface.
We will see one more contour map for practice and then we will move onto visualize
Also, the shade difference between the corresponding contours is not large it means that they
are close to each other and the loss value is not decreasing that much decreasing between the
contours. These flat regions will be high regions because their color is coded in red that
indicates the error value will be high in these regions.
Now coming to the blue regions of the plot marked with yellow lines, the distance between
the contours is large that means the slope in these regions will be gentle and these will be flat
surfaces. The error value in these regions will be on the lower side because these are color-
coded in light blue. The white region in the plot indicates that when we are transitioning
from red to blue somewhere we hit the white color. The error value in the white region will
be medium it’s not high and not low.
The topology of this white region also is a flat plateau because the distance between the two
consecutive orange contours is large. Let’s see how the 3D surface would look like,
3D Surface
As we interpreted, we have the four plateaus at different heights based on the error value and
all of these four plateaus are rapidly converging into the valley (dark blue region) where the
error is minimum.
The points at the bottom indicate the different combinations of w & b (parameters) and the
points on the contour indicate the loss value for the corresponding parameter values. By
looking at the 3D plot try to visualize how the 2D contour plot would look like, from the
gradient descent loss animation, you would have observed for the first few iterations while
the curve is still on the flat light red surface the updates are moving very slowly that means
we would expect the distance between the contours is large.
Once the curve reaches the edge of the plateau it rapidly converges into the dark blue valley
that means we would expect consecutive contours to be very close to each other. Now let’s
see how the 2D contour look like,
As expected in the region where the gradient descent curve starts, the distance between the
consecutive contours is large. Once the curve starts to move towards the dark blue region we
can see that the distance between consecutive contours is very small that indicates there is a
steep slope along that direction.
Now we will see an animation which shows how the gradient descent update moves on the
2D contour plot. That’s about it, this how we interpret contour plots.