تنظيم صفحاتك في مجموعات يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
في هذا التمرين، ستعيد الاطّلاع على الرسم البياني لبيانات كفاءة استهلاك الوقود من تمرين "المَعلمات". ولكن هذه المرة، ستستخدم الانحدار التدرّجي لمعرفة قيم الوزن والانحياز المثلى لنموذج خطي يقلل الخسارة.
أكمِل المهام الثلاث أدناه الرسم البياني.
المهمة 1: عدِّل شريط التمرير معدل التعلّم أسفل الرسم البياني لضبط معدل تعلّم يبلغ 0.03. انقر على الزر Start (بدء) لتشغيل دالة التدرج التنازلي.
ما هي المدة التي يستغرقها تدريب النموذج للتقارب (الوصول إلى الحد الأدنى الثابت لقيمة الخسارة)؟ ما هي قيمة MSE عند تقارب النموذج؟ ما هي قيم الوزن والميل التي تؤدي إلى ظهور هذه القيمة؟
انقر على رمز الإضافة للاطّلاع على الحلّ.
عندما ضبطنا معدّل التعلّم على 0.03، تقارب النموذج بعد حوالي 30 ثانية، وحقّق قيمة MSE أقل بقليل من 3 مع قيمتَي الوزن والانحراف -2.08 و23.098 على التوالي. يشير ذلك إلى أنّنا اخترنا قيمة جيدة لدرجة التعلّم.
المهمة 2: انقر على الزر إعادة الضبط أسفل الرسم البياني لإعادة ضبط قيم "الوزن" و"الانحراف" في الرسم البياني. اضبط شريط التمرير معدل التعلّم على قيمة تتراوح بين 1.10e–5. انقر على الزر Start (بدء) لتشغيل دالة التدرج التنازلي.
ما الذي لاحظته بشأن المدة التي يستغرقها تدريب النموذج للتقارب هذه المرة؟
انقر على رمز الإضافة للاطّلاع على الحلّ.
بعد مرور عدة دقائق، لم يكتمل تدريب النموذج بعد. إنّ تعديلات صغيرة على قيمتَي "الوزن" و"الانحراف" تؤدي إلى قيم أقل قليلاً للخسارة. يشير ذلك إلى أنّ اختيار معدّل تعلُّم أعلى سيتيح للانحدار التدرّجي العثور على قيم الوزن والانحياز المثلى بشكل أسرع.
المهمة 3: انقر على الزر إعادة الضبط أسفل الرسم البياني لإعادة ضبط قيم "المُدخل" و"المُشغِّل" في الرسم البياني. اضبط شريط تمرير معدل التعلّم حتى 1. انقر على الزر Start (بدء) لتشغيل دالة التدرّج التنازلي.
ماذا يحدث لقيم الخسارة أثناء تنفيذ خوارزمية انحدار التدرج؟ ما المدة التي ستستغرقها عملية تدريب النموذج للتقارب هذه المرة؟
انقر على رمز الإضافة للاطّلاع على الحلّ.
تتفاوت قيم الخسارة بشكل كبير عند القيم العالية (متوسط خطأ التربيع أكثر من 300). يشير ذلك إلى أنّ معدّل التعلّم مرتفع جدًا، ولن يصل تدريب النموذج أبدًا إلى حالة التقارب.
تاريخ التعديل الأخير: 2025-06-29 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-06-29 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["In this exercise, you'll revisit the graph of fuel-efficiency data from\nthe [Parameters exercise](/machine-learning/crash-course/linear-regression/parameters-exercise). But this time, you'll\nuse gradient descent to learn the optimal weight and bias values for a linear\nmodel that minimizes loss.\n\nComplete the three tasks below the graph.\n| This interactive visualization can produce flashing visuals when set to a high Learning Rate, which may affect photosensitive individuals.\n\n**Task #1:** Adjust the **Learning Rate** slider below the graph to set a\nlearning rate of 0.03. Click the **Start** button to run gradient descent.\n\nHow long does the model training take to converge (reach a stable minimum\nloss value)? What is the MSE value at model convergence? What weight and bias\nvalues produce this value?\n\nClick the plus icon to see our solution \nWhen we set a learning rate of 0.03, the model converged after\napproximately 30 seconds, achieving a MSE of just under 3 with weight and\nbias values of --2.08 and 23.098, respectively. This indicates we've\npicked a good learning rate value.\n| **Note:** The data points in the graph vary slightly each time you load the page, so your solutions here may be a little different than ours.\n\n**Task #2:** Click the **Reset** button below the graph to reset the Weight and\nBias values in the graph. Adjust the **Learning Rate** slider to a value around\n1.10e^--5^. Click the **Start** button to run gradient descent.\n\nWhat do you notice about how long it takes the model training to converge\nthis time?\n\nClick the plus icon to see the solution \nAfter several minutes, model training still hasn't converged. Small\nupdates to Weight and Bias values continue to result in slightly lower\nloss values. This suggests that picking a higher learning rate would\nenable gradient descent to find the optimal weight and bias values more\nquickly.\n\n**Task #3:** Click the **Reset** button below the graph to reset the Weight\nand Bias values in the graph. Adjust the **Learning Rate** slider up to 1.\nClick the **Start** button to run gradient descent.\n\nWhat happens to the loss values as gradient descent runs? How long will model\ntraining take to converge this time?\n\nClick the plus icon to see the solution \nLoss values fluctuate wildly at high values (MSE over 300).\nThis indicates that the learning rate is too high, and model training\nwill never reach convergence."]]