Gradient Descent Path Plot Calculator

Explore optimisation paths, compare gradient methods, adjust learning settings, diagnose convergence, and understand every update through interactive contour and surface visualisations with detailed metrics.

Objective Function

Choose a surface or define your own two-variable objective.

Starting Point and Search Bounds

Adds extra runs inside the selected bounds.

Optimiser and Learning Settings

Applied to stochastic and mini-batch modes.
Use zero to disable clipping.

Iterations and Stopping Rules

Comparison Mode

Overlay optimisers, learning rates, and starting points.

Use Control or Command for multiple choices.

Plot and Display Options

6
3
0.78

Formula Used

θ(t + 1) = θ(t) − α(t)∇J(θ(t))

The parameter vector moves opposite the local gradient. The learning rate controls each update distance. Optimiser rules can modify that direction and scale.

Adam update

m(t) = β₁m(t−1) + (1−β₁)g(t)
v(t) = β₂v(t−1) + (1−β₂)g(t)²
θ(t+1) = θ(t) − α·m̂(t)/(√v̂(t)+ε)

How to Use

  1. Select an objective function.
  2. Choose a starting point and bounds.
  3. Set an optimiser and learning rate.
  4. Adjust stopping and display controls.
  5. Add comparison settings when needed.
  6. Press Calculate and Plot.
  7. Inspect paths, diagnostics, and iteration details.
  8. Export the required report or dataset.

Example Settings

ObjectiveStartOptimiserLearning rateExpected behaviour
Quadratic(2.5, -1.5)Momentum0.08Fast movement toward one minimum.
Rosenbrock(-1.4, 1.6)Adam0.002Curved progress through a narrow valley.
Himmelblau(-3, -3)RMSProp0.01Convergence toward one local minimum.
Linear MSE(0, 0)Batch gradient descent0.03Slope and intercept approach fitted values.

Interpretation and Common Diagnostics

A smooth falling loss usually indicates stable optimisation. Repeated crossings often indicate an excessive learning rate. Very slow movement can indicate undersized updates.

Plateaus can occur near flat regions or saddle points. Exploding gradients create very large steps. Clipping can limit those unstable updates.

Different starting points may reach different local minima. Optimiser comparisons reveal sensitivity to update rules. Always inspect both loss and path geometry.

Frequently Asked Questions

What does the path represent?

It shows every parameter position visited during optimisation. Each segment represents one update.

Why can the path oscillate?

The learning rate may be too large. Momentum can also preserve excessive movement.

Why does gradient descent stop early?

A tolerance, patience limit, optimum distance, or divergence rule may have triggered.

What is a contour line?

It connects locations with equal objective values. Tight spacing indicates steeper surface regions.

Which optimiser should I choose?

Start with Adam for difficult surfaces. Compare it with simpler methods before deciding.

What does gradient clipping do?

It limits gradient magnitude before updating parameters. This can reduce unstable jumps.

Can custom functions be used?

Yes. Enter a supported expression using x and y. Numerical derivatives provide a fallback.

Why use several starting points?

Non-convex functions can contain multiple minima. Multiple starts expose different convergence outcomes.

What is the gradient norm?

It measures gradient magnitude. Small values often indicate a stationary region.

Related Calculators

Cost Function CurveContour Plot3D Loss SurfaceLearning-Rate Comparison PlotRegularisation CurveSigmoid Function GraphSoftmax Probability PlotEntropy CurveGini Impurity CurveCross-Entropy Loss Curve

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.