Machine Learning Training Algorithms

Core ML training algorithms: gradient descent variants, backpropagation, optimization methods (SGD, Adam, RMSprop), and when to use each.

  • JSON12,111 B
  • YAML8,300 B · −31%
  • TOON7,225 B · −40%

Training algorithms for machine learning, including gradient descent in its batch, stochastic and mini-batch forms, momentum, RMSprop, Adam, backpropagation and learning-rate schedules, each with type, mechanism, update rule, pros, cons and when to use it, plus practical tips.

Use it when

  • You need to understand or choose a training procedure.
  • You are debugging unstable training.

Watch out for

  • Training behavior depends on initialization, batch size and learning rate; defaults do not transfer across all problems.
  • Backpropagation computes gradients; the optimizer decides how to use them.

The data

Algorithms

NameTypeHow it worksUpdate ruleProsConsUse whenHyperparametersPhasesKey formulaNotesVariantsStrategiesPurpose
Gradient Descent (Batch)First-order optimizationComputes gradient over entire training set, updates parameters in opposite direction of gradient.θ = θ - α × ∇J(θ)
  • Converges to global minimum for convex functions
  • Stable convergence
  • Slow for large datasets (full pass each iteration)
  • Memory intensive
Small-to-medium datasets, convex optimization, need exact gradientnullnullnullnullnullnullnull
Stochastic Gradient Descent (SGD)First-order optimizationUpdates parameters per training example; gradient estimate noisy but cheap.For each example: θ = θ - α × ∇J(θ; xᵢ, yᵢ)
  • Fast per update
  • Can escape shallow local minima (noise)
  • Works with massive datasets
  • Noisy convergence
  • May never converge exactly
  • Requires learning rate schedule
Large-scale learning, online learning, deep neural networksnullnullnullnullnullnullnull
Mini-batch Gradient DescentFirst-order optimizationUpdate per mini-batch (typically 32-512 examples); balance between SGD and batch.For each batch B: θ = θ - α × (1/|B|) Σ ∇J(θ; xᵢ, yᵢ)
  • More stable than SGD
  • Vectorized operations (GPU-friendly)
  • Good convergence speed
  • Need to tune batch size
  • Still some noise
Default choice for most deep learning; works with GPU accelerationnullnullnullnullnullnullnull
MomentumGradient descent with velocityAccumulates velocity in consistent gradient directions; dampens oscillations.v = γv + α∇J(θ); θ = θ - v
  • Faster convergence on ravines
  • Reduces oscillations
  • Can escape shallow local minima
  • May overshoot if momentum too high
  • Requires tuning γ
Training deep nets, ill-conditioned problems
γ (momentum)
0.9 typical
α (learning rate)
same as SGD
nullnullnullnullnullnull
RMSpropAdaptive learning rateDivides learning rate by running average of squared gradients; adapt per-parameter.E[g²] = βE[g²] + (1-β)g²; θ = θ - α / √(E[g²] + ε) × g
  • Adapts learning rate per parameter
  • Handles sparse gradients well
  • Works for non-convex
  • May still need schedule
  • Biases early iterations
RNNs, sparse data, non-stationary objectives
β
0.9 typical
α
0.001 common
ε
1e-8 numerical stability
nullnullnullnullnullnull
Adam (Adaptive Moment Estimation)Adaptive + momentumCombines momentum (first moment) and RMSprop (second moment) with bias correction.m = β₁m + (1-β₁)g; v = β₂v + (1-β₂)g²; m̂ = m/(1-β₁ᵗ); v̂ = v/(1-β₂ᵗ); θ = θ - α × m̂ / (√v̂ + ε)
  • Robust default
  • Fast convergence
  • Low memory
  • Works for most problems
  • May generalize worse than SGD with momentum (some papers)
  • Can diverge if α too large
Default for most deep learning; quick prototyping
β₁
0.9 (momentum decay)
β₂
0.999 (RMSprop decay)
α
0.001 default
ε
1e-8
nullnullnullnullnullnull
BackpropagationGradient computation algorithmApplies chain rule efficiently through computational graph; forward pass then backward pass.nullnullnullnullnull
  • Forward: compute loss
  • Backward: compute ∂loss/∂params via chain rule
  • Update: optimizer step
δ = ∇ₐL ⊙ σ'(z); ∇ₐL = Wᵀδ (for layer)Not an optimizer itself — computes gradients for any optimizer to use. Works with any differentiable model.
  • Standard backprop (DAG)
  • Backprop through time (RNN)
  • Reverse-mode autodiff (frameworks)
nullnull
Learning Rate SchedulesMeta-strategynullnullnullnullnullnullnullnullAdam often doesn't need schedule, but warmup helps early training stabilitynull
Step decay
Drop LR by factor every N epochs
Exponential decay
α = α₀ × e^{-kt}
1/t decay
α = α₀ / (1 + kt)
Cosine annealing
Cosine curve from α₀ to 0
Warmup
Gradually increase LR from 0 to α₀ in first few epochs
Prevent oscillation near minimum, allow large initial steps, fine-tune later

Practical tips

  • Start with Adam (α=0.001) for quick results; switch to SGD+momentum (α=0.1) for final tuning if generalization suffers
  • Normalize inputs (zero mean, unit variance) for stable gradient descent
  • Use gradient clipping (norm or value) to prevent exploding gradients (especially RNNs)
  • Monitor training/validation loss curves to detect divergence or plateaus
  • Batch normalization helps stabilize gradients in deep networks

Fields

The shape of this dataset, read from the data itself: every column, its type and a real value. Agents can use this to plan a query without fetching the whole document.

SectionFieldTypeExample
algorithmsnamestringGradient Descent (Batch)
algorithmstypestringFirst-order optimization
algorithmshow_it_worksstringComputes gradient over entire training set, upd…
algorithmsupdate_rulestringθ = θ - α × ∇J(θ)
algorithmsprosarray[2 items]
algorithmsconsarray[2 items]
algorithmsuse_whenstringSmall-to-medium datasets, convex optimization, …
algorithmshyperparametersobject{γ (momentum),α (learning rate)}
algorithmsphasesarray[3 items]
algorithmskey_formulastringδ = ∇ₐL ⊙ σ'(z); ∇ₐL = Wᵀδ (for layer)
algorithmsnotesstringNot an optimizer itself — computes gradients fo…
algorithmsvariantsarray[3 items]
algorithmsstrategiesobject{step_decay,exponential_decay,1/t_decay,cosine_annealing}
algorithmspurposestringPrevent oscillation near minimum, allow large i…
practical_tips*array[5 items]

Fetch the same bytes

The static files contain the same reference rows as the API, with no API rate limit. Live metadata, such as view counts, may differ. Use the API for content negotiation; use the static files for a cacheable snapshot.

curl "https://yjtoon.yunusemrevurgun.com/api/dataset/ml-training-algorithms?format=toon"
const res = await fetch(
  "https://yjtoon.yunusemrevurgun.com/static-data/dataset/ml-training-algorithms.toon"
);
const toon = await res.text();

Rate limit: 120 requests per minute per IP, no key and no signup. API reference →

Topics

  • machine-learning
  • training
  • optimization
  • gradient-descent
  • backpropagation

Search the library

Search by a topic, title, or keyword.

Start with a collection

Browse all 205 datasets