Agendamentos da Taxa de Aprendizado e Aquecimento
Estratégias de passo, cosseno e aquecimento
Agendamentos da Taxa de Aprendizado e Aquecimento é uma aula grátis de Deep Learning Academy no CoddyKit. Esta é a aula 4 de 4. Você pode ler a aula completa abaixo gratuitamente — depois pratica ao vivo no navegador com um editor de código integrado e um tutor de IA 24/7. Faz parte do caminho de aprendizado de Deep Learning Academy, e seu progresso é sincronizado entre a web e o app CoddyKit. O curso de Deep Learning Academy inclui 4 aulas no total.
Partes desta aula ainda não foram traduzidas e aparecem em inglês.
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. 📉
Perguntas Frequentes
A aula “Agendamentos da Taxa de Aprendizado e Aquecimento” é grátis?
Sim — o texto completo de “Agendamentos da Taxa de Aprendizado e Aquecimento” é grátis para ler aqui na web. Para praticá-la interativamente (um editor de código integrado e um tutor de IA 24/7) e desbloquear o restante do curso de Deep Learning Academy, atualize para CoddyKit PRO. O curso de Deep Learning Academy inclui 4 aulas no total.
O que vou aprender em “Agendamentos da Taxa de Aprendizado e Aquecimento”?
Estratégias de passo, cosseno e aquecimento Você pratica Deep Learning Academy com código prático que executa diretamente no navegador, e um tutor de IA 24/7 responde suas dúvidas enquanto trabalha na aula.
Preciso ter experiência prévia para começar Deep Learning Academy?
Nenhuma experiência prévia é necessária. Deep Learning Academy no CoddyKit é estruturado para alunos iniciantes até avançados, então você pode começar aqui ou desde o início e aprender no seu ritmo. Esta é a aula 4 de 4.
Quanto tempo leva a aula “Agendamentos da Taxa de Aprendizado e Aquecimento”?
A maioria das aulas CoddyKit leva cerca de 5–10 minutos. Cada uma é compacta e interativa, então você faz progresso constante e retoma exatamente de onde parou entre web e app.
Posso escrever e executar código nesta aula de Deep Learning Academy?
Sim. Cada aula de Deep Learning Academy inclui um editor de código integrado, então você escreve e executa código real direto no navegador e recebe feedback de IA instantaneamente — nenhuma configuração local necessária.
Todas as aulas deste curso
- SGD com Momentum
- Adam e AdamW Explicados
- Decaimento de Pesos vs Regularização L2
- Agendamentos da Taxa de Aprendizado e Aquecimento