What is a convex function and why does it matter for optimization?medium

Type
conceptual
Topic
optimization
Frequency
common
Tags
optimization
Answer

A convex function has a bowl shape - any line segment between two points on the curve lies above the curve. Any local minimum is also the global minimum, making gradient descent guaranteed to find the optimal solution.

Explanation

Linear regression with MSE loss is convex - gradient descent finds the exact global minimum. Neural network loss functions are non-convex (many local minima, saddle points). Despite this, neural networks train well because the loss landscape in high dimensions has many acceptable minima, and saddle points are more common than bad local minima. Second derivative (Hessian) determines local curvature: positive definite Hessian -> local minimum, negative definite -> local maximum.

Follow-upWhat is the difference between convex and strongly convex functions?