جداول معدل التعلّم وWarmup
استراتيجيات الخطوة وcosine وwarmup
جداول معدل التعلّم وWarmup درس مجاني في Deep Learning Academy على CoddyKit. هذا هو الدرس 4 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Deep Learning Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Deep Learning Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
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. 📉
تعلم Python مع معلم ذكاء اصطناعي — مجانًا
اكتب وقم بتشغيل أكوادك الفعلية في المتصفح، واحصل على مساعدة فورية من معلم ذكاء اصطناعي متاح 24/7، واستمر من حيث توقفت على الويب أو في التطبيق.
- الدورات
- 30
- الدروس
- 120
الأسئلة الشائعة
هل درس «جداول معدل التعلّم وWarmup» مجاني؟
نعم — نص درس «جداول معدل التعلّم وWarmup» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Deep Learning Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Deep Learning Academy 4 دروس في المجموع.
ماذا ستتعلم في «جداول معدل التعلّم وWarmup»؟
استراتيجيات الخطوة وcosine وwarmup تتمرن على Deep Learning Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Deep Learning Academy؟
لا تُشترط خبرة سابقة. Deep Learning Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 4 من أصل 4.
كم من الوقت يستغرق درس «جداول معدل التعلّم وWarmup»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Deep Learning Academy هذا؟
نعم. كل درس في Deep Learning Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- SGD مع Momentum
- شرح Adam وAdamW
- اضمحلال الأوزان مقابل تنظيم L2
- جداول معدل التعلّم وWarmup