Gradient Descent
Gradient Descent is an optimization algorithm that helps models learn patterns from data by minimizing prediction errors through iterative parameter updates.
Gradient Descent in Simple Words
Imagine you are standing on a hill in fog and want to reach the lowest point. You cannot see the whole hill, so you check which way slopes downward, take a small step, and repeat. Gradient Descent does the same thing with a model's error.
Goal: keep changing the model's parameters until the error becomes small and further useful improvement is limited.
What is Gradient Descent?
Gradient Descent is an optimization algorithm used to minimize a loss function by repeatedly adjusting model parameters in the direction that reduces error.
In simple terms: Gradient Descent teaches a machine learning model how to improve itself step by step.
Real-Life Intuition
Imagine standing on a mountain in dense fog and trying to reach the lowest valley. You cannot see the complete landscape, but you can feel the slope beneath your feet.
- If the ground slopes downward → move that way
- If slope becomes flatter → slow down
- Repeat → move toward a lower-loss region
This is the basic intuition behind Gradient Descent.
Interactive Gradient Descent Simulator
Watch the parameter w roll down the loss curve. Experience how the Learning Rate (α) dictates smooth convergence vs chaotic overshoot.
A Tiny ML Example
| Current model | Prediction | Actual | What next? |
|---|---|---|---|
| Marks = 8 × Hours + 20 | 52 | 60 | Adjust the model slightly so the next prediction moves closer to 60 |
Gradient Descent tells us the direction and size of that small adjustment. It does not randomly change the model.
Core Objective of Gradient Descent
The main goals are:
- Choose model parameters that reduce the loss
- Move step by step instead of guessing parameters randomly
- Continue until the loss stops improving enough for our training goal
- Provide a practical way to train many differentiable machine learning models
Visual Overview of Gradient Descent
This U-shaped curve is a simple teaching example. Real models can have much more complicated loss surfaces.
Core Components of Gradient Descent
Hierarchical Structure
Cost Function
Measures Error
Gradient
Direction of Change
Learning Rate
Step Size
Understanding the Cost Function
A Cost Function measures how wrong a model's predictions are.
For the same dataset and chosen loss function, a lower cost usually means the model's predictions fit the training examples better.
Cost Function Visualization
Illustration: in a healthy training run, loss often trends downward, although real curves can be noisy or temporarily flat.
Mean Squared Error (MSE)
MSE is a common cost function used in regression models.
Formula
MSE = (1/n) * Σ(yᵢ - ŷᵢ)²- yᵢ = actual value
- ŷᵢ = predicted value
- n = total samples
Worked Example for MSE
| Actual | Predicted |
|---|---|
| 10 | 12 |
| 20 | 18 |
| 30 | 33 |
Step 1 — Find each prediction error and square it
Subtract prediction from actual value. Squaring removes the sign and gives larger errors more weight.
- (10 - 12)² = (-2)² = 4
- (20 - 18)² = (2)² = 4
- (30 - 33)² = (-3)² = 9
Step 2 — Add the squared errors
4 + 4 + 9 = 17
Step 3 — Divide by the number of observations
- MSE = (4 + 4 + 9) / 3
- MSE = 17 / 3
- MSE = 5.67
What is a Gradient?
For one parameter, think of the gradient as the slope of the loss curve. With many parameters, the gradient is a vector of partial derivatives.
- Its sign/direction tells us which way the loss increases fastest locally
- Its magnitude tells us how steep the local change is
- Gradient Descent moves in the opposite direction to try to reduce the loss
Gradient Descent moves in the opposite direction of the gradient to reduce errors.
Gradient Visualization
Tangent (Slope)
Gradient Descent moves in the opposite direction of the gradient slope.
Gradient Descent Formula
Parameter Update Equation
θ = θ - α * (∂J/∂θ)- θ = parameter or weight
- α = learning rate
- J = cost function
- ∂J/∂θ = gradient
Formula Breakdown
The equation means:
- Calculate current error
- Find gradient
- Move opposite gradient direction
- Update parameter
- Repeat until minimum error
Worked Example of One Gradient Descent Step
Use a tiny cost function so we can see where the gradient comes from:
J(w) = (w - 3)²Suppose the current weight is w = 5 and the learning rate is α = 0.1.
Step 1 — Find the current cost
J(5) = (5 - 3)² = 2² = 4
Step 2 — Find the gradient (slope)
For J(w) = (w - 3)², the derivative is 2(w - 3).
gradient = 2(5 - 3) = 4
Step 3 — Apply the update rule
w_new = 5 - 0.1 × 4
w_new = 5 - 0.4 = 4.6
Step 4 — Check whether the cost became smaller
J(4.6) = (4.6 - 3)² = 1.6² = 2.56
The cost fell from 4 to 2.56. One small step moved the parameter in a useful direction.
Step-by-Step Working Process
Complete Gradient Descent Workflow
Learning Rate in Gradient Descent
The learning rate determines the size of each parameter update step.
Learning Rate Formula
W_new = W_old - α × gradientLearning Rate Visualization
The learning rate (η) is one of the most important settings in gradient-based optimization. It controls how large a step the algorithm takes at each update. If it is too small, learning can be slow. If it is too large, the loss may oscillate or even diverge.
Too Small
Start → · → · → · → Minimum
Steps are tiny. The loss may decrease, but training can take many updates.
Useful Size
Start → → → Minimum
Steps reduce the loss steadily without repeatedly jumping past the low-loss region.
Too Large
Left ⇄ Right ⇄ Left
Steps can overshoot. The loss may bounce, grow, or fail to settle.
There is no universal “perfect” learning rate. A useful value depends on the model, data, optimizer, scaling and training setup.
| Learning Rate | What It Means | Behaviour | Risk |
|---|---|---|---|
| Too Small | Step is tiny for this problem | Tiny steps, crawls toward minimum | Slow training or slow progress |
| Too Large | Step is too large for this problem | Overshoots minimum, bounces wildly | Divergence, loss increases |
| Useful | A tested, useful range for this problem | Steady, smooth convergence | Still validate and monitor |
💡 Practical Tips for Choosing Learning Rate
- Start from a sensible value suggested by the algorithm/framework example, then watch training and validation loss
- Try a few orders of magnitude rather than assuming one universal value works everywhere
- A learning-rate schedule can reduce the step size as training progresses
- Adaptive optimizers such as Adam adjust effective per-parameter step sizes, but the base learning rate still matters
Problems with Learning Rate
| Learning Rate | Effect |
|---|---|
| Too Small | Extremely slow training |
| Too Large | Divergence and instability |
| Useful Range | Steady progress for this training setup |
Variants of Gradient Descent
Gradient Descent has several variants optimized for different datasets and computational requirements.
Hierarchical Tree of Gradient Descent Variants
1. Batch Gradient Descent
Core idea
Batch GD computes one parameter update using the gradient aggregated across the entire training dataset. Think of it as a professor who reviews the whole class before deciding how to adjust the teaching — informed by every example, but potentially expensive.
Because it aggregates information across all m training examples, its update is deterministic for a fixed dataset and parameter state and is usually smoother than stochastic updates. The trade-off is computation: every update must process the full training set. Implementations can stream or vectorize data, so the entire dataset does not literally have to fit in RAM at once.
Batch GD Formula
θ = θ - α * (1/m) * Σ ∇J_i(θ)Where m = total number of samples.
Workflow Diagram
Characteristics
- Dataset Usage: Full dataset
- Speed per step: Slow
- Stability: High
- Memory Usage: High
Advantages
- Stable convergence
- Accurate gradients
- Smooth optimization path
Disadvantages
- Slow for huge datasets
- Each update must process the full training set
- Inefficient for real-time learning
Best Use Cases:
Small datasets, Convex optimization problems, Offline training
Batch GD Numericals / Example
Suppose a dataset has 1000 records. Wait for all 1000 examples to calculate the cumulative gradient.
Gradient sum = Σ (error_i) for i=1 to 1000
Let total gradient = 4500, m = 1000, lr = 0.01.
θ = θ - 0.01 * (4500 / 1000)
θ = θ - 0.045
Result: Only 1 parameter update happens per epoch.
2. Stochastic Gradient Descent (SGD)
Core idea
SGD updates model parameters after every single training example. Rather than waiting to see all data, it makes a quick, rough guess at the gradient from one sample and immediately takes a step. Think of a student who adjusts study strategy after every single practice question — very reactive, sometimes erratic, but learns fast.
Because each update uses one sampled training example, the gradient estimate is noisy and the path can look "bouncy." That noise can sometimes help exploration of a non-convex loss surface. In modern deep learning, stochastic optimization is commonly implemented with mini-batches rather than strictly one example at a time.
SGD updates parameters after processing each individual training example.
SGD Formula
θ = θ - α * ∇J_i(θ)Where `i` is a randomly selected single data point.
SGD Workflow
Characteristics
- Dataset Usage: One sample
- Speed per step: Very Fast
- Stability: Noisy / High Variance
- Memory Usage: Very Low
Advantages
- Very cheap individual updates
- Lowest memory usage
- Helps escape shallow local minima (due to noise)
- Suitable for online streaming learning
Disadvantages
- Unstable and erratic convergence path
- Oscillates heavily around the minimum
- Single-example updates usually use accelerator hardware less efficiently than well-sized mini-batches
Best Use Cases:
Streaming data, Online systems where memory is heavily constrained.
SGD Numericals / Example
Dataset with 1000 records. For the first item, error gradient = 5, lr = 0.01.
θ = θ - 0.01 * 5
θ = θ - 0.05
Result: 1000 parameter updates happen sequentially per epoch.
3. Mini-Batch Gradient Descent
Core idea — a widely used practical approach
Mini-Batch GD splits the training data into smaller batches and updates parameters after each batch. It often gives a practical balance: more stable gradient estimates than single-example SGD while allowing efficient vectorized computation. Mini-batch training is widely used in deep learning.
Batch size is an important training choice. Smaller batches usually produce noisier gradient estimates and use less memory. Larger batches usually produce smoother estimates and may use more accelerator memory. The best size depends on the model, hardware and dataset.
Mini-Batch Gradient Descent combines the strengths of Batch GD and SGD. Instead of using the entire dataset or a single sample, it uses small, manageable batches.
Mini-Batch GD Formula
θ = θ - α * (1/B) * Σ_batch ∇J_i(θ)Where `B` is the batch size (e.g., 32, 64).
Mini-Batch Workflow
Characteristics
- Dataset Usage: Small batches
- Speed per step: Fast
- Stability: Balanced
- GPU Efficiency: Often good
Advantages
- Faster than Batch GD
- More stable than SGD
- Efficient for GPUs
- Widely used in Deep Learning
Disadvantages
- Batch size tuning required
- More hyperparameters
Common Batch Sizes:
| Batch Size | Usage |
|---|---|
| 16 | Small memory systems |
| 32 | Common starting point in some workloads |
| 64 | Another common experimental choice |
| 128+ | May suit hardware-efficient larger-batch training |
Advanced Optimizers
Momentum Optimization
Momentum modifies gradient-based updates by accumulating part of previous update directions, which can reduce zig-zagging and speed progress along consistent directions.
Core Idea: Momentum behaves like a rolling ball: motion from earlier steps carries forward, so repeated movement in a similar direction can build up while some oscillation is smoothed.
Momentum Formula
v_t = β*v_(t-1) + α*∇J(θ)Visualization
Standard SGD (Noisy Zig-Zag)
With Momentum (Smooth & Fast)
Worked Example / Numerical
- Previous velocity = 2
- β (momentum term) = 0.9
- Gradient (∇J) = 3
- α (learning rate) = 0.1
v_t = 0.9 * 2 + 0.1 * 3
v_t = 1.8 + 0.3 = 2.1
θ_new = θ_old - 2.1
This simplified convention carries part of the previous update into the new one. Different texts/libraries may write the momentum equation with slightly different signs or scaling conventions.
Adagrad Optimizer
Adagrad adapts learning rates individually for each parameter.
Main Idea: Frequent parameters receive smaller learning rates. Rare parameters receive larger learning rates. Useful for sparse datasets.
Adagrad Formula
θ = θ - (α / √(G_t + ε)) * g_t- G_t = Sum of squared past gradients
- g_t = Current gradient
- ε = Small smoothing term (1e-8) to prevent division by zero
Advantages
- Automatic LR adjustment
- Good for sparse data
- Automatically adapts effective step sizes
Disadvantages
- LR continuously decreases
- Effective step sizes can become very small over time
Real Applications: NLP models, Sparse recommendation systems.
Adagrad Numerical
Step 1: g_1 = 4. G_1 = 4² = 16.
Update 1: θ = θ - (0.1 / √16) * 4 = θ - (0.1 / 4) * 4 = θ - 0.1
Step 2: g_2 = 3. G_2 = 16 + 3² = 25.
Update 2: θ = θ - (0.1 / √25) * 3 = θ - (0.1 / 5) * 3 = θ - 0.06
Notice how the effective learning rate denominator (√G_t) keeps growing, shrinking the step size over time.
RMSProp Optimizer
RMSProp improves Adagrad by preventing excessive learning-rate decay by using exponential moving averages of squared gradients instead of a simple cumulative sum.
RMSProp Formula
E[g²]_t = β * E[g²]_(t-1) + (1-β) * g²_tθ = θ - (α / √(E[g²]_t + ε)) * g_tAdvantages
- Uses a moving average instead of an ever-growing sum
- Can avoid Adagrad's continually shrinking effective steps
- Useful in many neural-network settings
Disadvantages
- More hyperparameters (requires tuning β)
Applications: Recurrent Neural Networks (RNNs), Sequence models.
RMSProp Numerical
Let β = 0.9, past avg E[g²] = 10, current gradient g_t = 5, lr = 0.1.
E[g²]_new = 0.9*10 + 0.1*(5²) = 9 + 2.5 = 11.5
θ = θ - (0.1 / √11.5) * 5
θ ≈ θ - 0.147
Adam Optimizer
Adam (Adaptive Moment Estimation) is a widely used optimizer for neural networks. It keeps moving averages of both gradients and squared gradients so that update sizes adapt across parameters.
Adam Formula
m_t = β1 * m_(t-1) + (1 - β1) * g_t // Momentum estimatev_t = β2 * v_(t-1) + (1 - β2) * g²_t // RMSProp estimatem̂_t = m_t / (1 - β1^t), v̂_t = v_t / (1 - β2^t)θ = θ - α * m̂_t / (√v̂_t + ε)The hats show Adam's bias-corrected first and second moment estimates.
Adam Architecture Flow
Advantages
- Adaptive: Adjusts effective update sizes across parameters
- Practical: Often works well with noisy mini-batch gradients
- Common: Frequently used for large neural-network training
- Accessible: Implemented directly in major deep-learning libraries
Disadvantages
- Memory usage: Stores 2 extra states (m, v) per parameter
- Settings: Learning rate matters; β1 and β2 are often left near standard defaults but can also be tuned
- No optimizer is universally best; final generalization and convergence depend on the problem and training setup.
Adam Use Cases: Deep neural networks, Transformers (LLMs), Computer vision, NLP systems.
Adam Numerical — First Step
Let α = 0.1, β1 = 0.9, β2 = 0.999, current gradient g = 10, and start with m₀ = 0, v₀ = 0.
Step 1 — First moment
m₁ = 0.9(0) + 0.1(10) = 1
Step 2 — Second moment
v₁ = 0.999(0) + 0.001(10²) = 0.1
Step 3 — Bias correction
m̂₁ = 1 / (1 - 0.9) = 10
v̂₁ = 0.1 / (1 - 0.999) = 100
Step 4 — Parameter step (ignoring tiny ε in this hand calculation)
step = 0.1 × 10 / √100
step = 0.1
This example is intentionally one-dimensional so the mechanics are easy to see. Real models apply the same idea to many parameters.
Comparison of Gradient Descent Variants
| Variant | Speed | Stability | Memory | Best For |
|---|---|---|---|---|
| Batch GD | Slow | High | High | Small datasets |
| SGD | Fast | Low | Low | Online learning |
| Mini-Batch | Fast | Medium | Medium | Deep learning |
| Momentum | Problem-dependent | Smoother directions | Low extra state | Reducing oscillation |
| Adagrad | Medium | Medium | Medium | Sparse data |
| RMSProp | Problem-dependent | Adaptive steps | Extra state | Neural-network optimization |
| Adam | Often fast in practice | Adaptive steps | Two moment states | Many neural-network tasks |
Common Challenges in Gradient Descent
1. Local Minima
On non-convex loss surfaces, gradient-based optimization may reach a local minimum or another region that is not the global minimum. In large neural networks, saddle points and flat regions can also be important optimization challenges.
Python Demonstration:
import numpy as np
# Loss function: y = x^4 - 3x^2 + x
# It has two valleys: one lower (global) and one higher (local).
def gradient(x):
return 4*(x**3) - 6*x + 1
x_stuck = 1.5 # Starting near local min
x_good = -2.0 # Starting near global min
lr = 0.05
epochs = 20
# Doing GD from x_stuck
for _ in range(epochs): x_stuck = x_stuck - lr * gradient(x_stuck)
print(f"Stuck at local min x = {x_stuck:.2f}") # Output: ~1.00
# Doing GD from x_good
for _ in range(epochs): x_good = x_good - lr * gradient(x_good)
print(f"Reached global min x = {x_good:.2f}") # Output: ~-1.302. Saddle Points
A point where the slope is zero, but it's not a minimum. It curves up in one direction and down in another. GD drastically slows down here because the gradient is nearly zero.
Python Demonstration:
# Loss function y = x^3. Saddle point is at x = 0
def gradient(x): return 3*(x**2)
x = 0.5
lr = 0.1
print(f"Start: {x:.2f}")
for _ in range(5):
grad = gradient(x)
x = x - lr * grad
print(f"Step: {x:.4f}, Grad: {grad:.4f}")
# Output shows gradient getting infinitely small.
# GD takes forever to cross x=0. Advanced optimizers like Momentum fix this.3. Vanishing Gradient Problem
In deep neural networks (many layers), gradients are multiplied together during backpropagation. If gradients are small (e.g., < 1), multiplying them causes the gradient reaching early layers can become extremely small. Those layers may then learn very slowly.
Python Demonstration:
# Deep network simulation backpropagating a Sigmoid derivative
# Sigmoid derivative maxes at 0.25
layer_gradients = [0.25, 0.25, 0.25, 0.25, 0.25]
gradient = 1.0 # Error at end
for i, deriv in enumerate(layer_gradients):
gradient = gradient * deriv
print(f"Layer {5-i} Gradient: {gradient:.5f}")
# Reaches 0.00097 at Layer 1. The first layer will not update its weights!
# Fix: Use ReLU activation instead of Sigmoid.
4. Exploding Gradient Problem
The opposite of vanishing gradients. If gradients are consistently > 1, repeated multiplication can make them grow very large. Updates may become unstable and numerical overflow can eventually produce `NaN` values.
Python Demonstration:
# Weights > 1 multiplied over 10 layers (e.g. RNNs)
layer_weights = [1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5]
gradient = 1.0
import math
try:
for i, w in enumerate(layer_weights):
gradient = gradient * w
print(f"Layer {i+1} Gradient: {gradient:.2f}")
# Gradient quickly blows up to ~57.66
# Fix: Gradient Clipping
# Prevent gradient from exceeding 5.0
gradient = min(gradient, 5.0)
print(f"Clipped Gradient safe: {gradient}")
except OverflowError:
print("Gradient Exploded to Infinity!")Convergence in Gradient Descent
Convergence means reaching minimum error, stable parameter updates, and minimal further improvements.
- Iteration 1 → Very High Error
- Iteration 5 → Reduced Error
- Iteration 20 → Small Error
- Iteration N → Stable Low Error
Gradient Descent in Linear Regression
Gradient Descent helps Linear Regression learn the best-fit line.
Linear Regression Formula
y = wx + bWorked Example:
Suppose: x = 5, w = 2, b = 1
Prediction: y = 2(5) + 1 = 10 + 1 = 11
If actual value = 15:
Error = 15 - 11 = 4
Gradient Descent updates weights to reduce this error.
Python Implementation Example
Interactive: From-Scratch Gradient Descent Loop
Tune the learning rate (step size) and training epochs to observe the weight updates and loss minimization.
Size of the step taken in the opposite direction of the gradient.
Number of full passes over the dataset.
| 1 | import numpy as np |
| 2 | |
| 3 | # 1. Sample Dataset (True relationship: Y = 2*X + 3) |
| 4 | X = np.array([1, 2, 3, 4, 5]) |
| 5 | Y = np.array([5, 7, 9, 11, 13]) |
| 6 | n = len(X) |
| 7 | |
| 8 | # 2. Initialize Parameters |
| 9 | w = 0.0 |
| 10 | b = 0.0 |
| 11 | learning_rate = 0.01 |
| 12 | epochs = 1000 |
| 13 | |
| 14 | # 3. Gradient Descent Loop |
| 15 | initial_loss = np.mean((Y - (w * X + b)) ** 2) |
| 16 | |
| 17 | for epoch in range(1, epochs + 1): |
| 18 | y_pred = w * X + b |
| 19 | # Compute MSE gradients |
| 20 | dw = (-2 / n) * np.sum(X * (Y - y_pred)) |
| 21 | db = (-2 / n) * np.sum(Y - y_pred) |
| 22 | # Update parameters |
| 23 | w = w - learning_rate * dw |
| 24 | b = b - learning_rate * db |
| 25 | |
| 26 | final_loss = np.mean((Y - (w * X + b)) ** 2) |
| 27 | |
| 28 | print(f"Initial MSE Loss: {initial_loss:.4f}") |
| 29 | print(f"Final w (slope): {w:.4f} (True Target: 2.0)") |
| 30 | print(f"Final b (intercept): {b:.4f} (True Target: 3.0)") |
| 31 | print(f"Final MSE Loss: {final_loss:.6f}") |
| 32 | print(f"Completed {epochs} Epochs with Learning Rate α = {learning_rate}") |
Line-by-Line Explanation:
- Import Libraries: Numpy for math, Matplotlib for charts.
- Sample Dataset: A perfectly linear toy relationship:
y = 2x + 3. - Initialize Parameters: Start with weights
w=0, b=0, set small step sizeLR=0.01, and run 2000 times (epochs) for this tiny example. - Gradient Descent Loop:
y_predcalculates current guesses.dw, dbcompute the MSE gradients with respect towandb.w = w - ...steps the weights in the correct direction.
- Visualization: Plots original dots against the final trained red line.
Terminal Output
Final w: 2.00, Final b: 3.00
Visual Output (Simulation)
Training Process Visualization
Advantages
- Simple: Easy implementation
- Scalable: Mini-batch/stochastic variants can scale to large datasets
- Flexible: Useful for many differentiable objectives
- Powerful: Enables deep learning
- Efficient: Can optimize models with many parameters
Disadvantages
- Sensitive to learning rate: Poor tuning affects training
- Local minima: Non-convex loss surfaces can have local minima, saddle points and flat regions
- Slow convergence: Large models require time
- Hyperparameter tuning: Learning rate and optimizer settings can require experimentation
- Gradient issues: Vanishing/exploding gradients
Industry Applications of Gradient Descent
Hierarchical Industry Tree
- CNNs
- RNNs
- Transformers
- Training Forecasting Models
- Training Risk Models
- Training Fraud Models
- Disease Prediction
- Medical Imaging
- Drug Discovery
- Netflix
- Amazon
- YouTube
- Face Recognition
- Object Detection
- Autonomous Vehicles
Best Practices
- Scale features when the model/optimizer is sensitive to feature scale
- Choose and monitor the learning rate
- Monitor loss curves
- Compare optimizers when appropriate
- Use mini-batches when they suit the workload
- Initialize weights properly
- Use learning-rate scheduling
End-to-End Gradient Descent Pipeline
Input Dataset
│
▼
Initialize Parameters
│
▼
Forward Propagation
│
▼
Compute Loss
│
▼
Calculate Gradients
│
▼
Update Parameters
│
▼
Repeat Iteratively
│
▼
Model ConvergenceCommon Questions About Gradient Descent
Why do we move opposite to the gradient?
The gradient points toward the steepest local increase in loss, so moving in the negative-gradient direction is the local downhill choice.
Does Gradient Descent always find the global minimum?
For some convex problems it can converge to the global minimum under suitable conditions. For non-convex problems, there is no general guarantee.
What happens if the learning rate is too high?
Updates can overshoot useful low-loss regions, causing oscillation or divergence.
Continue Learning
Gradient Descent is easier to connect when you already understand the model it is optimizing. Review Linear Regression, then continue to Polynomial Regression, Ridge Regression, and Lasso Regression.
Final Summary
Gradient Descent is a fundamental optimization method used by many machine learning and deep learning models. It learns parameters iteratively by using gradients to search for lower values of a chosen loss function.
Modern neural networks are usually trained with stochastic or mini-batch gradient-based optimizers. Depending on the task, practitioners may use SGD with momentum, Adam, RMSProp, or other variants and schedules.
Most Important Insight to Remember:
"The loss function tells us how costly the current predictions are; Gradient Descent uses local slope information to take repeated steps toward lower loss."