|
|
||
|
This interactive sandbox visualizes optimization algorithms for finding minima in 1D and 2D functions: Hill Climbing, Gradient Descent, Simulated Annealing, Nelder-Mead (Simplex), and Coordinate Descent. Each algorithm is implemented as a JavaScript generator, allowing step-by-step execution so you can pause, resume, and observe how they navigate the optimization landscape. Switch between 2D f(x) (canvas) and 3D f(x,y) (Plotly surface + contour) modes. The path is shown as a magenta trail with a bright current marker. For Simulated Annealing, the marker color transitions from red (hot) to blue (cold). For Nelder-Mead, a green simplex triangle with Best/Good/Worst vertices and an orange centroid shows the "Amoeba" flipping across the landscape. Hill Climbing greedily moves to the neighboring point with the lowest value—it can get stuck in local minima (candidate dots show evaluated points). Gradient Descent follows the negative gradient with a tangent line at each step. Simulated Annealing uses Metropolis-Hastings: it may accept worse moves with probability exp(−ΔE/T). Nelder-Mead uses a simplex (triangle) that reflects, expands, contracts, or shrinks. Coordinate Descent minimizes along one axis at a time (axis-aligned steps). Use the function presets to explore: 2D (Bowl, Peaks, Jagged, Double Well, Triple Valley, Gentle Waves) and 3D (Paraboloid, Rosenbrock, Two Basins, Three Basins, Mild Rastrigin, Saddle Valleys). Drag on the graph to set the initial position.
Parameters
Buttons
Visualization Features
|
||