Convex functions guarantee gradient descent finds the global minimum. Non-convex (like neural nets) can trap you in local minima - which is why tricks like momentum and random restarts matter.
Try: Multi-Valley with lr=0.05 - which local minimum does the ball find? Reset and try lr=0.15 - does it escape?
Convex Functions - Interactive Visualization
Convexity is the property that makes optimization tractable. A convex function has exactly one minimum - gradient descent will always find it. Non-convex functions (like deep network loss landscapes) have local minima where gradient descent can get stuck. This visualization rolls a ball down three function types: a convex bowl, a multi-valley non-convex function, and a function with a saddle point.
Watch a ball roll to minimum on convex (bowl) vs non-convex (valleys) surfaces
See how local vs global minima differ in non-convex landscapes
Understand why convexity guarantees global optimality
See saddle points - gradient is zero but not a minimum
Connect to why deep learning requires careful initialization
Part of the EngineersOfAI Interactive 3D - free interactive visualizations covering every major concept in machine learning and AI engineering. Hover any element for a plain-English explanation. No code required.