Why Convexity Is The Key To Optimization: Convex Sets
Why Convexity Is The Key To Optimization: Convex Sets
Convex Sets
To simply things, think of convex sets as shapes where any line joining 2 points in this set is
never outside the set. This is called a convex set.
Take a look at the examples below.
It is evident that any line joining 2 points on a circle or say a square (the shapes on extreme left
and middle), will have all the line segments within the shape. These are examples of convex
sets.
On the other hand, the shape on the extreme right in the figure above has part of a line outside the
shape. Thus, this is not a convex set.
A convex set C can be represented as follows.
Epigraph
Convex Function
Okay, now that you understand what are convex sets and epigraphs, we can talk about
convex functions.
A function f is said to be a convex function if its epigraph is a convex set (as seen in the green
figure below on the left).
This means that every line segment drawn on this graph is always equal to or above the function
graph. Pause a minute and check for yourself.
This means that a function f is not convex if there exist two points x, y such that the line
segment joining f(x) and f(y), is below the curve of the function f. This causes the loss of
convexity of the epigraph (as seen in the red-figure above on the right ).
This means that every line segment drawn on this graph is not always equal to or above the
function graph. The same can be proven by taking points on the bends.
Instead of converging to the global minimum, you can see that gradient descent would stop at the
local minimum because the gradient at that point is zero (slope is 0) and minimum in the
neighborhood. One way to solve this issue is by using the concept momentum.
Conclusion
Convex functions play a huge role in optimization. Optimization is the core of a machine learning
model. Understanding convexity is really important for the same, which I believe you did from
this article.
https://towardsdatascience.com/understand-convexity-in-optimization-db87653bf920