يمكننا تصور هذه المعادلة كما هو موضح أدناه، حيث $x_1$، $x_2$ و $x_3$ هي عُقد الإدخال الثلاث (باللون الأزرق)، و $y'$ هي عقدة الإخراج (باللون الأخضر).
التمرين 1
في النموذج أعلاه، يشتمل الوزن تم تحديد قيم الانحياز بشكل عشوائي التهيئة. قم بإجراء المهام التالية للتعرف على ونستكشف النموذج الخطي. يمكنك تجاهل القائمة المنسدلة دالة التفعيل في الوقت الحالي؛ سنناقش هذا الموضوع لاحقًا في الوحدة.
انقر على الزر "تشغيل" (▶️) فوق الشبكة لحساب قيمة عقدة الإخراج لقيم الإدخال $x_1 = 1.00$، $x_2 = 2.00$، $x_3 = 3.00$.
انقر فوق العقدة الثانية في طبقة الإدخال، وزيادة القيمة من 2.00 إلى 2.50. لاحظ أن قيمة عقدة الإخراج تتغير. اختَر الناتج العُقد (باللون الأخضر) وراجع لوحة العمليات الحسابية لمعرفة كيف يمكن أن يكون الناتج حساب القيمة.
انقر فوق عقدة الإخراج (باللون الأخضر) لمشاهدة الوزن ($w_1$، $w_2$، $w_3$) قيم معلمة التحيز ($b$). خفض قيمة الوزن لـ $w_3$ (مرة أخرى، لاحظ أن قيمة عقدة الإخراج والحسابات أدناه تغيرت). بعد ذلك، قم بزيادة قيمة التحيز. الاطّلاع على كيفية إجراء هذه التغييرات قد أثرت في ناتج النموذج.
إضافة طبقات إلى الشبكة
لاحظ أنه عندما تم ضبط قيم الوزن والتحيز للشبكة في تمرين 1، الذي لم يغير الرياضيات الإجمالية العلاقة بين المدخلات والمخرجات. لا يزال نموذجنا خطيًا.
ولكن ماذا لو أضفنا طبقة أخرى إلى الشبكة بين طبقة الإدخال وطبقة الإخراج؟ في مصطلحات الشبكة العصبية، هناك طبقات إضافية بين تُسمى طبقة الإدخال وطبقة الإخراج الطبقات المخفية والعُقد في هذه الطبقات الخلايا العصبية.
وتُحسب قيمة كل خلية عصبية في الطبقة المخفية بنفس طريقة حساب ناتج نموذج خطي: ناتج عن مجموع حاصل ضرب كل واحد من مُدخلاته (الخلايا العصبية في طبقة الشبكة السابقة) ومعلَمة الوزن الفريدة، بالإضافة إلى التحيز. وبالمثل، فإن الخلايا العصبية في الطبقة التالية (هنا، طبقة الإخراج) باستخدام قيم الخلية العصبية في الطبقة المخفية كمدخلات.
تسمح هذه الطبقة الجديدة لنموذجنا بإعادة تجميع بيانات الإدخال باستخدام طبقة مجموعة من المعاملات. هل يمكن أن يساعد ذلك نموذجنا في تعلّم العلاقات غير الخطية؟
التمرين 2
لقد أضفنا طبقة خفية تحتوي على أربع خلايا عصبية إلى النموذج.
انقر على الزر "تشغيل" (▶️) فوق الشبكة لحساب قيمة العقد الأربعة المخفية الطبقات وعقدة الإخراج لقيم الإدخال $x_1 = 1.00$، و$x_2 = 2.00$، و $x_3 = 3.00$.
ثم استكشف النموذج، واستخدمه للإجابة عن الأسئلة التالية.
كم عدد والمعامل (القيم المرجحة والتحيزات) هذا التحليل نموذج الشبكة؟
4
كان لنموذجنا الأصلي في التمرين 1 أربع معلَمات: w11 وw21 w31 وb. ولأن هذا النموذج يحتوي على طبقة مخفية، فهناك المزيد من المعاملات.
12
تجدر الإشارة إلى أنّ العدد الإجمالي للمعلَمات يتضمّن كلتا المَعلمتَين. لحساب قيم العقدة في الطبقة المخفية من وقيم المدخلات والمعلمات المستخدمة لحساب قيمة الإخراج من قيم العقدة في الطبقة المخفية.
16
لاحظ أن العدد الإجمالي للمعلمات يشمل كلاً من الوزن ومعاملات التحيز.
21
هناك 4 معلمات مستخدمة لحساب كل قيمة من قيم العقدة الأربع في الطبقة المخفية—3 أوزان (واحدة لكل قيمة إدخال) التحيز - والذي مجموعه 16 معلمة. ثم يتم استخدام 5 معلمات لحساب قيمة المخرجات: 4 ترجيحات (واحدة لكل عقدة في طبقة مخفية) وتحيز. وبالإجمال، تضم هذه الشبكة العصبية 21 المعلَمات.
جرِّب تعديل معاملات النموذج ولاحظ التأثير في قيم العقدة المخفية الطبقة وقيمة المخرجات (يمكنك مراجعة لمعرفة كيف كانت هذه القيم، تظهر في لوحة العمليات الحسابية أدناه الحساب).
هل يمكن لهذا النموذج أن يتعلّم الأمور غير الخطية؟
نعم
انقر على كل عقدة من العقد في الطبقة المخفية وعقدة الإخراج، وراجع العمليات الحسابية أدناه. ما الذي تلاحظه حول كل هذه العمليات الحسابية؟
لا
إذا نقرت على كل عقدة في الطبقة المخفية وراجعت العمليات الحسابية أدناه، سترى أن جميعها تكون خطية (التي تشمل عمليات الضرب والجمع).
إذا قمت بعد ذلك بالنقر فوق عقدة الإخراج ومراجعة العملية الحسابية أدناه، سترى أن هذه العملية الحسابية خطية أيضًا. المساواة بين نقاط الاتصال العمليات الحسابية التي يتم إجراؤها على مخرجات العمليات الحسابية الخطية وكذلك خطية، مما يعني أن هذا النموذج لا يمكنه التعرف على الخطوط غير الخطية.
تاريخ التعديل الأخير: 2024-08-16 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2024-08-16 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["To build a [**neural network**](/machine-learning/glossary#neural_network)\nthat learns [**nonlinearities**](/machine-learning/glossary#nonlinear),\nbegin with the following familiar model structure: a\n[**linear model**](/machine-learning/glossary#linear-model) of the form\n$y' = b + w_1x_1 + w_2x_2 + w_3x_3$.\n\nWe can visualize this equation as shown below, where $x_1$,\n$x_2$, and $x_3$ are our three input nodes (in blue), and $y'$ is our output node\n(in green).\n\nExercise 1\n\nIn the model above, the [**weight**](/machine-learning/glossary#weight) and\n[**bias**](/machine-learning/glossary#bias) values have been randomly\ninitialized. Perform the following tasks to familiarize yourself with the\ninterface and explore the linear model. You can\nignore the *Activation Function* dropdown for now; we'll discuss this\ntopic later on in the module.\n\n1. Click the Play (▶️) button above the network to calculate the value of\n the output node for the input values $x_1 = 1.00$, $x_2 = 2.00$, and\n $x_3 = 3.00$.\n\n2. Click the second node in the\n [**input layer**](/machine-learning/glossary#input-layer), and increase\n the value from 2.00\n to 2.50. Note that the value of the output node changes. Select the output\n nodes (in green) and review the *Calculations* panel to see how the output\n value was calculated.\n\n | **Notes about calculations:**\n | - Values displayed are rounded to the hundredths place.\n | - The `Linear()` function simply returns the value it is passed.\n3. Click the output node (in green) to see the weight ($w_1$, $w_2$, $w_3$) and\n bias ($b$) parameter values. Decrease the weight value for\n $w_3$ (again, note that the value of the output node and the calculations below\n have changed). Then, increase the bias value. Review how these changes\n have affected the model output.\n\nAdding layers to the network\n\nNote that when you adjusted the weight and bias values of the network in\n[Exercise 1](#exercise_1), that didn't change the overall mathematical\nrelationship between input and output. Our model is still a linear model.\n\nBut what if we add another layer to the network, in between the input layer\nand the output layer? In neural network terminology, additional layers between\nthe input layer and the output layer are called\n[**hidden layers**](/machine-learning/glossary#hidden_layer), and the nodes\nin these layers are called\n[**neurons**](/machine-learning/glossary#neuron).\n\nThe value of each neuron in the hidden layer is calculated the same way as the\noutput of a linear model: take the sum of the product of each of its inputs\n(the neurons in the previous network layer) and a unique weight parameter,\nplus the bias. Similarly, the neurons in the next layer (here, the output layer)\nare calculated using the hidden layer's neuron values as inputs.\n\nThis new hidden layer allows our model to recombine the input data using another\nset of parameters. Can this help our model learn nonlinear relationships?\n\nExercise 2\n\nWe've added a hidden layer containing four neurons to the model.\n\nClick the Play (▶️) button above the network to calculate the value of\nthe four hidden-layer nodes and the output node for the input values\n$x_1 = 1.00$, $x_2 = 2.00$, and $x_3 = 3.00$.\n\nThen explore the model, and use it to answer the following questions. \nHow many [**parameters**](/machine-learning/glossary#parameter) (weights and biases) does this neural network model have? \n4 \nOur original model in [Exercise 1](#exercise-1) had four parameters: w~11~, w~21~, w~31~, and b. Because this model contains a hidden layer, there are more parameters. \n12 \nNote that the total number of parameters includes both the parameters used to calculate the node values in the hidden layer from the input values, and the parameters used to calculate the output value from the node values in the hidden layer. \n16 \nNote that the total number of parameters includes both the weight parameters and the bias parameters. \n21 \nThere are 4 parameters used to calculate each of the 4 node values in the hidden layer---3 weights (one for each input value) and a bias---which sums to 16 parameters. Then there are 5 parameters used to calculate the output value: 4 weights (one for each node in the hidden layer) and a bias. In total, this neural network has 21 parameters. \nTry modifying the model parameters, and observe the effect on the\nhidden-layer node values and the output value (you can review the\nCalculations panel below to see how these values were\ncalculated).\n\nCan this model learn nonlinearities? \nYes \nClick on each of the nodes in the hidden layer and the output node, and review the calculations below. What do you notice about all these calculations? \nNo \nIf you click on each of the nodes in the hidden layer and review\nthe calculations below, you'll see that all of them are linear\n(comprising multiplication and addition operations).\n\nIf you then click on the output node and review the calculation\nbelow, you'll see that this calculation is also linear. Linear\ncalculations performed on the output of linear calculations are\nalso linear, which means this model cannot learn nonlinearities.\n| **Key terms:**\n|\n| - [Bias](/machine-learning/glossary#bias)\n| - [Hidden layer](/machine-learning/glossary#hidden_layer)\n| - [Input layer](/machine-learning/glossary#input-layer)\n| - [Linear model](/machine-learning/glossary#linear-model)\n| - [Model](/machine-learning/glossary#model)\n| - [Neural network](/machine-learning/glossary#neural_network)\n| - [Neuron](/machine-learning/glossary#neuron)\n| - [Nonlinear](/machine-learning/glossary#nonlinear)\n| - [Parameter](/machine-learning/glossary#parameter)\n- [Weight](/machine-learning/glossary#weight) \n[Help Center](https://support.google.com/machinelearningeducation)"]]