Deep Learning Academy · درس

Dropout: إسقاط الخلايا العصبية عشوائيًا

أجبر النموذج على التكرار لتحقيق التعميم

الدرس 2 من 413 خطوة

Dropout: إسقاط الخلايا العصبية عشوائيًا درس مجاني في Deep Learning Academy على CoddyKit. هذا هو الدرس 2 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Deep Learning Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Deep Learning Academy 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

What Dropout Does

Dropout randomly turns off some neurons during each training step, so the network cannot lean on any single unit too heavily. 🎲

Why Random Drops Help

By dropping neurons at random, dropout forces the network to build redundant paths, which spreads knowledge and improves generalization.

The Dropout Rate

The dropout rate p is the chance each neuron is dropped. A value like 0.5 means roughly half the units are silenced each step.

Add It in PyTorch

You add dropout with one layer. Place nn.Dropout between linear layers to regularize the activations flowing through.

self.drop = nn.Dropout(p=0.5)
x = self.drop(torch.relu(self.fc1(x)))

Drops Change Every Step

Each forward pass drops a different random set of neurons, so the model effectively trains a huge ensemble of thinner networks.

Scaling Keeps It Fair

To keep the average signal steady, PyTorch scales the surviving activations up during training, so test-time outputs stay balanced.

Turn It Off at Eval

Dropout must be disabled during evaluation. Calling model.eval() switches it off so every neuron contributes to the prediction.

model.eval()
with torch.no_grad():
    preds = model(x_val)

Choosing a Rate

Common rates sit between 0.2 and 0.5. Higher values regularize more but can starve the network of signal if pushed too far.

Where to Place It

Put dropout on wide hidden layers where overfitting bites hardest. It is rarely applied right before the final output.

Dropout and CNNs

For convolutional features, plain dropout helps less. Many vision nets prefer Dropout2d or rely on batch norm instead.

A Cheap, Strong Tool

Dropout adds no extra parameters and costs almost nothing, yet it is one of the most reliable ways to shrink the train/val gap.

Quick Check

Think about what dropout should do when you evaluate the model.

Recap

You met dropout: randomly silencing neurons in training to force redundancy, then turning it off at eval for full, stable predictions. ✅

البدء مجانًا

تعلم Python مع معلم ذكاء اصطناعي — مجانًا

اكتب وقم بتشغيل أكوادك الفعلية في المتصفح، واحصل على مساعدة فورية من معلم ذكاء اصطناعي متاح 24/7، واستمر من حيث توقفت على الويب أو في التطبيق.

الدورات
30
الدروس
120

الأسئلة الشائعة

هل درس «Dropout: إسقاط الخلايا العصبية عشوائيًا» مجاني؟

نعم — نص درس «Dropout: إسقاط الخلايا العصبية عشوائيًا» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Deep Learning Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Deep Learning Academy 4 دروس في المجموع.

ماذا ستتعلم في «Dropout: إسقاط الخلايا العصبية عشوائيًا»؟

أجبر النموذج على التكرار لتحقيق التعميم تتمرن على Deep Learning Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Deep Learning Academy؟

لا تُشترط خبرة سابقة. Deep Learning Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 2 من أصل 4.

كم من الوقت يستغرق درس «Dropout: إسقاط الخلايا العصبية عشوائيًا»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Deep Learning Academy هذا؟

نعم. كل درس في Deep Learning Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. قراءة الفجوة بين التدريب والتحقق
  2. Dropout: إسقاط الخلايا العصبية عشوائيًا
  3. ‏Batch Norm وLayer Norm
  4. زيادة البيانات كبيانات مجانية
← العودة إلى Deep Learning Academy