Learning-rate schedules, warmup and gradient clipping in practice
Before this lesson: lesson 05 (the noise ball of SGD, the linear scaling rule) and lesson 06 (Adam and AdamW). The stability limit comes from lesson 03, the descent lemma from lesson 02. Time: about 80 minutes, plus the notebook.
Why this matters #
Almost every large model is trained with AdamW, a warmup, a decay and gradient clipping. GPT-3 used a linear warmup over the first 375 million tokens, a cosine decay to 10% of the peak learning rate, and clipped the global gradient norm at 1.0 (Brown et al. 2020, appendix B). LLaMA used 2,000 warmup steps, a cosine decay to 10% of the peak and clipping at 1.0 (Touvron et al. 2023). GraphCast, a weather model, used a linear warmup from 0 to over 1,000 steps and a half-cosine decay to 0 (Lam et al. 2023). Newer recipes replace the cosine by warmup–stable–decay (WSD), because it does not fix the training length in advance. When a run diverges or stalls, the schedule, the peak learning rate and the clipping threshold are the first things to check.
1. Predict first #
2. The picture #
A schedule is a function . In this lesson and in lesson 06 the step counter is , as in the Adam paper and the PyTorch documentation; is the total number of steps. Here are the common shapes. All of them start with the same linear warmup over steps.
Move the step slider and read for each schedule: warmup + cosine (violet), WSD with a linear (orange) or a 1−sqrt (orange, dashed) cooldown, linear decay (aqua) and step decay (magenta). Change the cooldown length : only the WSD curves move. Then press Plan 2T, stop at T: the cosine planned for twice the length (violet, dotted) is still at about half the peak when you stop.
Why decay at the end. Lesson 05 showed that SGD with a constant step does not converge to the minimizer. It reaches a noise ball: a cloud around the minimizer whose size is proportional to . A smaller gives a smaller cloud and a lower loss. But a small from the start would make slow progress. So we keep large while we are far from the minimum, and decay it at the end.
Why warm up at the start. The first steps are the least stable: the weights are random, the curvature can be high, and Adam's estimate of the gradient scale comes from only a few gradients. A short linear warmup lets the model reach a region where a large learning rate is safe. We look at the evidence in section 3.
The next figure runs SGD on a noisy quadratic with five schedules. It plots the exact expected loss, so the curves are smooth.
Compare the curves. All runs first fall to the same plateau: the noise ball for . The constant run stays there. The WSD runs stay there too, until the cooldown starts (dashed line), and then drop fast. The cosine run decays slowly from the start. The cosine planned for and stopped at (violet, dotted) is still high. Set σ = 0 (no noise): now the constant learning rate ends lowest, because decay only slows progress when there is no noise to remove.
Clipping limits the length of a step. Some losses have regions where the gradient and the curvature are both very large. A step of fixed size then jumps far past the minimum. For with , gradient descent from goes to , then , then : it diverges. Clipping caps the step length. With steps of length at most 1, the same run goes and converges.
Change the threshold and the step size . Plain gradient descent (blue) jumps from side to side with growing size. Clipped gradient descent (aqua) moves by at most per step. Clipping acts only inside the yellow band, where . The dashed lines mark where the local curvature equals ; outside them a plain step overshoots.
Warmup + cosine with , , and . What is at ?
The cosine phase has . So . The value is the linear decay at the same point; a cosine stays higher than a straight line in its first half.
In the noisy-quadratic figure with , the WSD curve is flat for most of the run and then drops sharply during the cooldown. Why does it drop?
The problem has one minimum and the noise level stays the same. The expected loss of the noise ball is proportional to (section 3). When decreases, the variance in a direction with curvature relaxes to its new level by the factor per step: fast in sharp directions. So the drop is quick, and it is not a new minimum.
3. Definitions and main results #
Schedules #
Notation: total steps, warmup steps, cooldown steps, the peak and the final value. Every schedule below starts with the linear warmup for .
| Schedule | after the warmup | Notes |
|---|---|---|
| constant | simplest; stays in the noise ball | |
| step decay | , = number of milestones passed | classic for ResNets () |
| exponential | smooth version of step decay | |
| cosine | , | needs in advance |
| linear decay | to zero: | |
| WSD | for ; then , | (linear) or (1−sqrt) |
A warmup–stable–decay (WSD) schedule has three phases: warmup, a long stable phase at , and a short cooldown (decay) phase. The name comes from MiniCPM (Hu et al. 2024). The 1−sqrt cooldown drops fast at first and then spends more of the cooldown at a small learning rate: at the middle of the cooldown () it is at of the peak, the linear one at .
Why decay: the noise ball is proportional to #
Proposition (noise ball of SGD in one direction). Let with , and let SGD use the stochastic gradient , where the noise has mean 0 and variance and is independent of . With a constant step ,
Proof.
- The update is .
- Square and take expectations. The cross term because is independent of . So .
- Write . Since , . The fixed point solves , so .
- , so .
- Subtract the fixed-point equation from step 2: . The gap shrinks by the factor per step, so . Multiply by for the loss.
Two consequences explain the shape of the loss curves.
- Halving about halves the plateau. The plateau is proportional to (exactly, up to the factor ).
- The drop after a decay is fast in sharp directions. By step 5, the gap to the new plateau shrinks by per step, so it takes about steps. Directions with large curvature adjust in a few steps. This is why the loss falls sharply at the start of a cooldown. It is the noise ball shrinking, not a new minimum.
Without noise () the plateau is 0, and a decay only slows the progress. Decay is a tool against noise.
You train with a constant learning rate and the loss has reached a plateau of about above its minimum, caused by minibatch noise. You divide the learning rate by 10 and keep everything else fixed. Where does the plateau go, to a first approximation?
The noise-ball loss is , proportional to when is small. Each step adds variance , but the pull back to the minimum also weakens: the factor . The ratio is proportional to .
Why a cosine cannot be stopped early, and why WSD can #
The cosine value at step depends on . At (with ) we have and . So if you stop a cosine run early, the model never had a phase with a small learning rate: it is still inside a large noise ball. If you want to train longer than planned, the learning rate is already low, and you need a new warmup. Every training length needs its own run.
WSD removes this problem (Hägele et al. 2024, section 3):
- The stable phase does not depend on . You can save checkpoints during it and start a short cooldown from any of them. One long run gives models for many training lengths. Studies of scaling laws, which need models trained for many lengths, therefore need far fewer runs.
- A cooldown of about 10–20% of the steps matched a tuned cosine schedule in their language-model experiments; the gains stopped growing near 20%. The 1−sqrt shape gave a lower loss than the linear shape.
- Averaging the weights of recent checkpoints (see the deeper block) also helped, at no extra training cost.
Bergsma et al. (2025) compared decay shapes for language models trained at compute-optimal budgets. A linear decay to zero beat a cosine decay to 10% of the peak. In one of their experiments, a 610M-parameter model trained on 80 tokens per parameter with decay to zero beat the 10× decay trained on 200 tokens per parameter, a compute saving of about 60%.
Why does a WSD schedule help a study of scaling laws, which needs models trained for many different numbers of steps?
The stable phase of WSD does not depend on the total length , so the run up to a checkpoint is the same for every . A cosine run must know from the start, so each length needs a new run. WSD matches cosine (with a cooldown of 10–20%); it does not beat every cosine.
Why warmup helps: the evidence #
- Sharpness. Kalra and Barkeshli (2024) studied warmup in detail. Its main effect is that the network can tolerate a larger target learning rate. During warmup, training moves to regions with lower sharpness , the top eigenvalue of the Hessian of the loss. So the large learning rate that comes later stays below the stability limit of lesson 03. Whether the sharpness first falls or first rises depends on the initialization and the parametrization. Lesson 11 studies sharpness and the edge of stability.
- Adam's second moment. Early in training, Adam's is estimated from very few gradients, so the first steps are badly scaled. The same paper shows that a better initial value of gives some of the benefit of warmup.
- Large batches. Goyal et al. (2017) trained ResNet-50 with batches of 8,192 images. With the linear scaling rule (learning rate proportional to the batch size, lesson 05), the scaled learning rate was too large for the first epochs. A gradual warmup over 5 epochs fixed this, and the large-batch model matched the small-batch accuracy.
Choosing the peak learning rate #
The peak is the most important number of the schedule. Too small: slow progress. Too large: the run diverges or keeps a large noise ball.
The learning-rate range test (Smith 2017; the "LR finder" of the fastai library):
- Start from the initialization, as in a real run.
- Train for a few hundred steps while grows, for example exponentially from to . (Smith increased it linearly over a few epochs; the exponential version is common today.)
- Record a smoothed training loss (an exponential moving average of the minibatch losses).
- Stop when the smoothed loss exceeds a few times its best value (fastai uses 4 times).
- Pick a learning rate clearly below the blow-up point. A common rule of thumb is one tenth of the with the lowest smoothed loss. This is a heuristic, not a theorem: it gives a safe start, and a short sweep around it (for example ×0.3 to ×10) often finds a faster value. The notebook shows such a case.
Run the test on a least-squares problem. The smoothed loss falls, reaches a minimum and blows up. The yellow dashed line is , the stability limit of full-batch gradient descent on this problem. The blow-up comes a little later, because divergence needs a few steps to show and the moving average lags. Switch the features to the same scale: drops and the whole curve moves right.
Link to the stability limit. On a quadratic with Hessian , gradient descent diverges exactly when (lesson 03). The range test finds this limit by experiment, for the real loss, at the start of training. Two cautions: the sharpness of a network changes during training (warmup lowers it, lesson 11 shows that it can also rise), and for Adam the relevant limit is for the preconditioned Hessian. So the range test gives a good starting value, not a guarantee.
Changing the batch size. For SGD, the linear scaling rule multiplies by when the batch size is multiplied by (Goyal et al. 2017; lesson 05). It stops working above the critical batch size. For Adam, Malladi et al. (2022) derived a square-root scaling rule (, together with changes of , and ). Treat both as starting points and check them with a short run.
Gradient clipping by global norm #
Let be the gradients of all parameter tensors of a model, viewed as one long vector. Its global norm is . Clipping by global norm with threshold replaces by
Properties.
- The direction is unchanged: the result is a positive multiple of .
- The length is .
- If , nothing changes. So clipping acts only on rare, large gradients.
- With step , a clipped step is with . So the step length is : at most .
In PyTorch, torch.nn.utils.clip_grad_norm_(params, max_norm) computes the global norm, multiplies every
gradient by when this factor is below 1, and returns the norm before clipping. Log this
number: a rising gradient norm often comes before a loss spike.
Other kinds of clipping change the direction. Clipping each tensor separately (per-tensor norm) or each entry
separately (clip_grad_value_, which clamps every entry to ) rescales different parts by different factors.
You clip by the global norm with threshold . Which statement is true for every step?
multiplies the whole vector by one positive number, so the direction stays the same. If , nothing changes, so the step is not always . Rescaling only some tensors is per-tensor clipping, which changes the direction.
Why clipping helps: -smoothness #
The convergence theory of lesson 02 assumes -smoothness, everywhere. Then the safe fixed step is about . But for the curvature has no upper bound, so no single exists. Zhang, He, Sra and Jadbabaie (2020) proposed a weaker condition.
Definition. A twice differentiable is -smooth if
With this is -smoothness. The new condition allows the curvature to grow where the gradient is large.
Example. is -smooth: we need . For , . For , . Zhang et al. also measured the local smoothness along real training runs and found that it grows with the gradient norm, most clearly for an LSTM language model.
Why a fixed step is slow and a clipped step is fast. A fixed step must be safe at the worst point the run can visit, where the curvature can be ( the largest gradient norm on the way). So it must be about , far too small elsewhere. The clipped step behaves like : the safe step for the local curvature.
The complexity bounds of Zhang et al. (informal)
Let be -smooth and bounded below by , let , and let . To reach :
- clipped gradient descent (with and a threshold set by and ) needs at most iterations;
- gradient descent with any fixed step needs, in the worst case, a number of iterations of order .
The first bound has no . When the start is poor ( large), clipped gradient descent can be arbitrarily faster. (Theorems 3 and 4 and Remark 5 of the paper.)
Reading loss curves #
A loss curve is the main tool to debug a schedule. These patterns are common; the first thing to try is listed.
| What you see | Likely cause | First thing to try |
|---|---|---|
| loss becomes NaN or explodes in the first hundreds of steps | too large for the early phase | lower or make the warmup longer; check that clipping is on |
| loss falls very slowly and smoothly | too small | run a range test, raise |
| loss flat for a long time at a constant , drops at the decay | noise ball (expected) | nothing to fix; decay earlier if you need a model now |
| isolated spikes that recover | rare large gradients or bad batches | log the gradient norm; clipping; lower ; Adam with |
| loss jumps up after resuming from a checkpoint | optimizer state or schedule step not restored | save and load the optimizer and scheduler state |
| training loss falls, validation loss rises | overfitting, not an optimizer problem | regularization, more data, early stopping |
Large language-model runs sometimes show loss spikes that do not recover. The PaLM team restarted such runs from a checkpoint about 100 steps before the spike and skipped about 200–500 batches of data (Chowdhery et al. 2022).
Schedule-free optimization and weight averaging
Weight averaging. Instead of the last iterate, use an average of recent iterates: stochastic weight averaging (SWA; Izmailov et al. 2018) or an exponential moving average (EMA) of the weights. Averaging reduces the noise of the final iterate, in a similar way to a learning-rate decay, and it costs no extra gradient computations. Diffusion models are usually evaluated with an EMA of the weights.
Schedule-free methods. Defazio et al. (2024) proposed schedule-free SGD and AdamW. They combine an averaged sequence with an interpolation step, need no stopping time , and in their experiments matched or beat cosine schedules on a wide range of problems. Schedule-free AdamW won the self-tuning track of the AlgoPerf 2024 benchmark. They still use a warmup.
Answers to section 1. (1) No. At step 50,000 the cosine planned for 100,000 steps is about halfway, so its learning rate is still about : the model never had a low-learning-rate phase and sits in a large noise ball. The cosine planned for 50,000 steps has decayed to and reaches a lower loss. (2) The gradient of norm 50 is scaled by : same direction, length 1. The gradient of norm 0.5 is not changed. (3) The loss drops within a short time to a new plateau about half as high (the noise ball is proportional to ), and then progress continues more slowly.
4. Worked example #
(a) Schedule values. , , .
Warmup + cosine with :
- (warmup): .
- : the warmup ends and , so .
- : , , so .
- : , , so .
- : , , so .
WSD with (20% of ) and : until .
- : . Linear: . 1−sqrt: .
- : . Linear: . 1−sqrt: .
(b) Clipping. Two tensors have gradients and ; the threshold is .
- Global norm: .
- Factor: .
- Clipped gradients: and . The direction is the same; the norm is 1.5.
For comparison, clipping each tensor to norm 1.5 gives and : the cosine with the original direction is 0.998. Clipping each value to gives , with cosine 0.962. Both change the direction.
(c) Clipped gradient descent on . , , . Then and the step length is .
- : , so the step has length 1: .
- : : .
- : : .
- : , no clipping: .
- : , and plain gradient descent continues to 0.
Plain gradient descent from the same start: , , . The local curvature at is , far above .
(d) The noise ball. For () with noise , the proposition gives the plateau : for , and for . Dividing by 10 divides the plateau by about 10.
5. In code #
NumPy checks the numbers of section 4. The notebook has these cells and the exercises.
import numpy as np
def warmup_cosine(t, T, W, lr_max, lr_min=0.0):
if t < W:
return lr_max * t / W
p = min(1.0, (t - W) / (T - W))
return lr_min + 0.5 * (lr_max - lr_min) * (1 + np.cos(np.pi * p))
def wsd(t, T, W, D, lr_max, lr_min=0.0, shape="linear"):
if t < W:
return lr_max * t / W
if t < T - D:
return lr_max
p = min(1.0, (t - (T - D)) / D)
s = 1 - p if shape == "linear" else 1 - np.sqrt(p)
return lr_min + (lr_max - lr_min) * s
# (a) the schedule values of section 4
T, W = 20_000, 2_000
print([f"{warmup_cosine(t, T, W, 1e-3, 1e-4):.3e}" for t in (1000, 2000, 6500, 11000, 20000)])
# ['5.000e-04', '1.000e-03', '8.682e-04', '5.500e-04', '1.000e-04']
print([f"{wsd(t, T, W, 4000, 1e-3, shape=s):.3e}" for s in ("linear", "1-sqrt") for t in (18000, 19000)])
# ['5.000e-04', '2.500e-04', '2.929e-04', '1.340e-04']
# (b) clipping by global norm keeps the direction
def clip_by_global_norm(grads, max_norm, eps=1e-6):
total = np.sqrt(sum(np.sum(g**2) for g in grads))
factor = min(1.0, max_norm / (total + eps))
return [g * factor for g in grads], total
clipped, total = clip_by_global_norm([np.array([2.0, -1.0]), np.array([2.0])], max_norm=1.5)
print(total, [c.round(4).tolist() for c in clipped]) # 3.0 [[1.0, -0.5], [1.0]]
# (c) GD and clipped GD on f(x) = x^4/4, eta = 0.1, threshold c = 10
x, y, eta, c = 5.0, 5.0, 0.1, 10.0
for k in range(4):
x = x - eta * x**3
g = y**3
y = y - min(eta, eta * c / abs(g)) * g
print(k + 1, f"{x:.5g}", f"{y:.4g}")
# 1 -7.5 4
# 2 34.688 3
# 3 -4139 2
# 4 7.0906e+09 1.2
# (d) the noise ball of SGD on f(x) = x^2/2 with gradient noise sigma = 1
rng = np.random.default_rng(0)
for eta in (0.1, 0.01):
x = np.zeros(20_000) # 20,000 independent runs
for _ in range(3000):
x -= eta * (x + rng.standard_normal(x.size))
print(eta, f"{np.mean(0.5 * x**2):.4f}", f"{eta / (2 * (2 - eta)):.4f}")
# 0.1 0.0260 0.0263
# 0.01 0.0025 0.0025
In PyTorch, the same schedules come from torch.optim.lr_scheduler (LinearLR, CosineAnnealingLR,
SequentialLR, or a LambdaLR with your own function), and clipping is one line before optimizer.step():
total = torch.nn.utils.clip_grad_norm_(model.parameters(), max_norm=1.0). With mixed precision and a gradient
scaler, unscale the gradients first (scaler.unscale_(optimizer)), then clip.
6. Where it shows up #
- Language models. AdamW with a linear warmup, a cosine, WSD or linear decay, and clipping at 1.0 is the standard pretraining recipe (GPT-3, LLaMA, MiniCPM). WSD is popular when the final training length is not known, or when one run should give checkpoints for several lengths.
- Vision. Step decay by 10× at fixed epochs was the classic ResNet recipe; Goyal et al. added a 5-epoch warmup for batches of 8,192 images. Vision transformers use warmup + cosine.
- ML for science. GraphCast used AdamW, a 1,000-step linear warmup and a half-cosine decay to 0 (Lam et al. 2023). Physics-informed neural networks are often trained with Adam and a step or exponential decay of the learning rate, and then refined with L-BFGS (lesson 10).
- Monitoring. Log the learning rate and the gradient norm before clipping at every step. Most training problems show up first in these two curves.
7. Common mistakes #
- Stopping a cosine run early, or extending it. The cosine value depends on . Plan , or use WSD.
- Schedule length in the wrong unit.
T_maxcounted in epochs whilescheduler.step()is called every batch (or the reverse): the schedule ends far too early or never decays. - Calling
scheduler.step()beforeoptimizer.step(). Since PyTorch 1.1 the scheduler is stepped after the optimizer; the other order skips the first value of the schedule. - Clipping per tensor or per value when you meant the global norm. Both change the direction of the update.
- Clipping before unscaling with mixed-precision loss scaling: the threshold then applies to the scaled gradients.
- Resuming without the optimizer and scheduler state. Adam's moments and the step counter restart, which is like a start without warmup at the peak learning rate.
- Reading a drop at the cooldown as a better model architecture or data change. It is the noise ball shrinking. Compare runs at the same point of their schedules.
- Taking the range-test minimum as the learning rate. The minimum is close to the blow-up point; pick a value clearly below it.
8. Check yourself #
- With , at which fraction of the cooldown is the learning rate , for the linear
and for the 1−sqrt shape?
Answer
Linear: , so . 1−sqrt: , so and . The 1−sqrt cooldown reaches half the peak twice as early. - You have a 10,000-step WSD run with a 10% cooldown and a 10,000-step cosine run. Now you need a model trained for
20,000 steps. What can you reuse?
Answer
From the WSD run: the checkpoint at step 9,000, the end of the stable phase. Continue at to step 18,000 and then cool down for 2,000 steps. The cosine run cannot be extended without a new warmup, because its learning rate has already decayed; you start a new run. - Two tensors have gradients and . What does
clip_grad_norm_withmax_norm=1.0return, and what are the clipped gradients?Answer
The global norm is , and the function returns 1.3. The factor is , so the gradients become about and : the same direction, norm 1. - For SGD on with , noise and , what is the
expected loss on the plateau?
Answer
. (The variance is , and .) - Your run diverges at step 40 with , a warmup of 10 steps and no clipping. List the
first two changes you would try, in order.
Answer
First a longer warmup (for example 1–5% of the steps) and/or a lower peak learning rate, checked with a range test. Second, turn on clipping by global norm (for example at 1.0) and log the gradient norm. Check also for bad data or a wrong loss scale. - Why is not -smooth, and which work for it?
Answer
grows without bound, so no constant bounds it. works: for and for .
Write the warmup + cosine schedule.
for ; then with .
What are the three phases of a WSD schedule?
Linear warmup, a long stable phase at , and a short cooldown (about 10–20% of the steps) to , linear or 1−sqrt.
Why does the loss drop sharply when the learning rate decays?
The noise ball of SGD has expected loss proportional to ( per direction). A smaller shrinks it, and sharp directions reach the new level within a few steps.
Why can a cosine schedule planned for 100k steps not be stopped at 50k?
At 50k its learning rate is still about : the model never had a low-learning-rate phase and sits in a large noise ball.
Give one reason why warmup helps.
During warmup, training moves to regions of lower sharpness, so the later large learning rate stays below the stability limit (also: Adam's early is poor; large-batch linear scaling).
Write clipping by global norm with threshold .
with over all tensors. Same direction, length .
What does
torch.nn.utils.clip_grad_norm_return?The global gradient norm before clipping (worth logging every step).
Define -smoothness.
for all : the curvature may grow where the gradient is large.
What is a learning-rate range test?
A short run in which grows (for example exponentially) while the smoothed loss is recorded; pick a value clearly below the point where the loss blows up.
With , what fraction of the peak is a 1−sqrt cooldown at its midpoint?
(the linear cooldown is at 0.5).
9. Interview angle #
- "Why warm up the learning rate?" — Early training is the least stable: sharpness can be high and Adam's is based on few gradients. Warmup lets the model move to flatter regions so the peak learning rate stays below ; with large batches and the linear scaling rule it is required (Goyal et al.).
- "Cosine or WSD?" — WSD matches cosine with a 10–20% cooldown, does not need in advance, and one run serves many lengths. Cosine needs and cannot be stopped early.
- "Why does the loss drop at the end of training?" — The learning-rate decay shrinks the noise ball of SGD; its loss is proportional to .
- "How do you choose the learning rate?" — A range test for the order of magnitude, then a small sweep around it; scale with the batch size (linear for SGD, about square root for Adam) and re-check.
- "Why clip by the global norm and not per value?" — The global norm keeps the update direction; per-value clipping changes it. Clipping helps on losses whose curvature grows with the gradient (-smoothness).
10. Practice #
The notebook for this lesson runs in Colab. It has four exercises, each with a check cell and a folded solution:
- Implement warmup + cosine and WSD (linear and 1−sqrt cooldowns) and check the values of section 4.
- Run SGD on a noisy quadratic with a constant, a cosine and a WSD schedule; compare the final loss with the noise-ball formula.
- Implement clipping by global norm over a list of arrays; check the norm, the direction and the returned value.
- Run a learning-rate range test for softmax regression on the scikit-learn digits data and pick a learning rate.
11. Watch and read #
- Hägele et al., Scaling Laws and Compute-Optimal Training Beyond Fixed Training Durations (2024): WSD, cooldown length and shape, weight averaging.
- Kalra and Barkeshli, Why Warmup the Learning Rate? Underlying Mechanisms and Improvements (2024).
- Zhang, He, Sra and Jadbabaie, Why gradient clipping accelerates training (ICLR 2020): -smoothness.
- Smith, Cyclical Learning Rates for Training Neural Networks (2017): the range test.
- Goyal et al., Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour (2017): linear scaling and warmup.
- Bergsma et al., Straight to Zero: Why Linearly Decaying the Learning Rate to Zero Works Best for LLMs (2025).
- Defazio et al., The Road Less Scheduled (2024): schedule-free optimization.
- Malladi et al., On the SDEs and Scaling Rules for Adaptive Gradient Algorithms (2022): the square-root scaling rule for Adam.
- PyTorch documentation: how to adjust the learning rate
and
clip_grad_norm_.
Runs in your browser with nothing to install. The notebook repeats the key demos and has exercises with checks; solutions are inside, folded.
No Google account needed: Python runs inside your browser. The first start downloads about 40 MB; your changes are saved in this browser only.