0Pricing
Deep Learning Academy · Lekcja

Harmonogramy learning rate i warmup

Poznać strategie step, cosine i warmup

Harmonogramy learning rate i warmup to bezpłatna lekcja Deep Learning Academy na CoddyKit. To lekcja 4 z 4. Możesz przeczytać całą lekcję poniżej za darmo — a potem ćwiczyć ją interaktywnie w przeglądarce z wbudowanym edytorem kodu i tutorem AI dostępnym 24/7. To część ścieżki edukacyjnej Deep Learning Academy, a Twój postęp synchronizuje się między webem a aplikacją CoddyKit. Kurs Deep Learning Academy zawiera 4 lekcji w sumie.

Części tej lekcji nie zostały jeszcze przetłumaczone i są wyświetlane po angielsku.

A Rate That Changes

One fixed learning rate is rarely ideal for the whole run. A schedule changes it over time, usually large early and small near the end.

Why Decay Helps

Big early steps cover ground fast. Shrinking the rate later lets the model settle precisely into a minimum instead of bouncing around it.

Step Decay

The simplest schedule is step decay: drop the rate by a fixed factor every set number of epochs, like halving it every thirty epochs.

sched = torch.optim.lr_scheduler.StepLR(opt, step_size=30, gamma=0.5)

Cosine Annealing

Cosine schedules glide the rate down a smooth curve toward zero. The gentle, gradual decay is a favorite for training modern networks.

sched = torch.optim.lr_scheduler.CosineAnnealingLR(opt, T_max=100)

The Cold-Start Problem

Fresh weights are fragile. A full-size rate on step one can blow up the loss, especially with large batches or deep transformers.

Warmup Eases In

Warmup ramps the rate up from near zero over the first few hundred steps. This gentle start keeps early training stable before full speed.

Warmup Then Decay

The classic recipe is warmup followed by decay: climb to the peak rate, then ride a cosine curve down. It is the go-to for big models.

Step the Scheduler

A scheduler does nothing until you call step() on it, usually once per epoch right after the optimizer updates the weights.

opt.step()
sched.step()

Watch the Current Rate

Log the live learning rate while you train. Seeing it warm up and decay confirms the schedule fires when expected and helps you debug.

print(sched.get_last_lr())

Plateau-Based Decay

Prefer reacting to results? ReduceLROnPlateau drops the rate only when validation loss stops improving, no fixed timetable needed.

sched = torch.optim.lr_scheduler.ReduceLROnPlateau(opt)

Schedules Are Free Wins

A good schedule often boosts final accuracy with zero extra data. Warmup plus cosine decay is a strong, safe default to start from.

Quick Check

Confirm what warmup is for.

Recap

A schedule shrinks the learning rate over time so the model settles cleanly, while warmup ramps it up first for stable starts. Warmup plus cosine is a great default. 📉

Często zadawane pytania

Czy lekcja „Harmonogramy learning rate i warmup” jest bezpłatna?

Tak — pełny tekst „Harmonogramy learning rate i warmup” jest dostępny za darmo tutaj w sieci. Aby ćwiczyć ją interaktywnie (wbudowany edytor kodu i tutor AI dostępny 24/7) i odblokować resztę kursu Deep Learning Academy, przejdź na CoddyKit PRO. Kurs Deep Learning Academy zawiera 4 lekcji w sumie.

Co nauczysz się w „Harmonogramy learning rate i warmup”?

Poznać strategie step, cosine i warmup Ćwiczysz Deep Learning Academy z praktycznym kodem, który uruchamiasz bezpośrednio w przeglądarce, a tutor AI dostępny 24/7 odpowiada na Twoje pytania podczas pracy nad lekcją.

Czy potrzebuję doświadczenia, aby zacząć Deep Learning Academy?

Nie wymagamy żadnego doświadczenia. Deep Learning Academy w CoddyKit jest strukturyzowany dla początkujących i zaawansowanych użytkowników, więc możesz zacząć tutaj lub od początku i uczyć się w swoim tempie. To lekcja 4 z 4.

Ile czasu zajmuje lekcja „Harmonogramy learning rate i warmup”?

Większość lekcji CoddyKit trwa około 5–10 minut. Każda lekcja to mały, interaktywny krok, dzięki czemu robisz systematyczne postępy i zawsze wracasz dokładnie do tego samego miejsca — na webie i w aplikacji.

Czy mogę pisać i uruchamiać kod w tej lekcji Deep Learning Academy?

Tak. Każda lekcja Deep Learning Academy zawiera wbudowany edytor kodu, więc piszesz i uruchamiasz prawdziwy kod bezpośrednio w przeglądarce i od razu otrzymujesz sprzężenie zwrotne od AI — bez konfiguracji na komputerze.

Wszystkie lekcje w tym kursie

  1. SGD z momentum
  2. Adam i AdamW wyjaśnione
  3. Weight decay a regularyzacja L2
  4. Harmonogramy learning rate i warmup
← Powrót do Deep Learning Academy