Deep Learning Academy · درس

تشير التدرجات إلى الأعلى — لذا تحرّك في الاتجاه المعاكس

استخدم الميل لتحسين الأوزان

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

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

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

Reading the Slope

To walk downhill you first need to know which way is down. The gradient is the tool that tells you the slope of the loss at your current spot.

Gradient Points Uphill

Here is the surprise: the gradient points in the direction where loss increases fastest. It shows you the steepest way up, not down.

So Step the Other Way

Since the gradient aims uphill, you move in the opposite direction to go down. Subtracting the gradient takes you toward lower loss.

w = w - grad

The Update Rule

This one line is the heart of training. You scale the gradient by a small step size, then subtract it from each weight. Repeat and loss drops.

w = w - lr * grad

Gradient Is a Vector

With many weights, the gradient is a whole vector: one slope per weight. Each weight gets nudged by its own piece of that vector.

Magnitude Means Steepness

A large gradient value means the loss is very steep in that direction, so that weight needs a bigger correction. Small values mean you are nearly flat there.

Where Gradient Is Zero

At the very bottom of a valley the slope flattens and the gradient becomes zero. With nothing to subtract, the weights stop moving. You have converged.

One Step at a Time

You almost never reach the bottom in one jump. Each step only improves things a little, so descent is a long series of tiny downhill moves.

Following the Negative Gradient

The path you trace by always heading along the negative gradient is the route of steepest descent. It is the greedy shortcut toward lower loss.

step = -grad

Why Subtraction Works

Subtracting moves you against the increase, so loss must fall for a small enough step. That simple sign flip is what turns a slope into progress.

Toward Automatic Gradients

You will rarely compute these slopes by hand. PyTorch's autograd finds the gradient for you, but the rule stays the same: subtract it to descend.

Quick Check

Which direction does the gradient point?

Recap

The gradient points uphill toward higher loss, so you subtract a scaled version of it to step down. Repeat that update and the model rolls toward the valley. ⬇️

البدء مجانًا

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

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

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

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

هل درس «تشير التدرجات إلى الأعلى — لذا تحرّك في الاتجاه المعاكس» مجاني؟

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

ماذا ستتعلم في «تشير التدرجات إلى الأعلى — لذا تحرّك في الاتجاه المعاكس»؟

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

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

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

كم من الوقت يستغرق درس «تشير التدرجات إلى الأعلى — لذا تحرّك في الاتجاه المعاكس»؟

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

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

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

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

  1. الخسارة كسطح نهبط عليه
  2. تشير التدرجات إلى الأعلى — لذا تحرّك في الاتجاه المعاكس
  3. معدل التعلّم: كبير جدًا، صغير جدًا، أو مناسب تمامًا
  4. تصغير دالة يدويًا باستخدام Python
← العودة إلى Deep Learning Academy