Neuronale Netzwerke: Knoten und verborgene Ebenen

Um ein neuronales Netzwerk zu erstellen, das Nichtlinearitäten lernt, beginnen Sie mit der folgenden bekannten Modellstruktur: einem linearen Modell der Form $y' = b + w_1x_1 + w_2x_2 + w_3x_3$.

Wir können diese Gleichung wie unten dargestellt visualisieren, wobei $x_1$, $x_2$ und $x_3$ unsere drei Eingangsknoten (blau) und $y'$ unser Ausgangsknoten (grün) sind.

Übung 1

In the model above, the weight and bias values have been randomly initialized. Perform the following tasks to familiarize yourself with the interface and explore the linear model. You can ignore the Activation Function dropdown for now; we'll discuss this topic later on in the module.

  1. Klicken Sie auf die Schaltfläche „Play“ (▶️) oberhalb des Netzwerks, um den Wert des Ausgabeknotens für die Eingabewerte $x_1 = 1.00$, $x_2 = 2.00$ und $x_3 = 3.00$ zu berechnen.

  2. Click the second node in the input layer , and increase the value from 2.00 to 2.50. Note that the value of the output node changes. Select the output nodes (in green) and review the Calculations panel to see how the output value was calculated.

  3. Click the output node (in green) to see the weight ($w_1$, $w_2$, $w_3$) and bias ($b$) parameter values. Decrease the weight value for $w_3$ (again, note that the value of the output node and the calculations below have changed). Then, increase the bias value. Review how these changes have affected the model output.

Hinzufügen von Schichten zum Netzwerk

Note that when you adjusted the weight and bias values of the network in Exercise 1 , that didn't change the overall mathematical relationship between input and output. Our model is still a linear model.

But what if we add another layer to the network, in between the input layer and the output layer? In neural network terminology, additional layers between the input layer and the output layer are called hidden layers , and the nodes in these layers are called neurons .

The value of each neuron in the hidden layer is calculated the same way as the output of a linear model: take the sum of the product of each of its inputs (the neurons in the previous network layer) and a unique weight parameter, plus the bias. Similarly, the neurons in the next layer (here, the output layer) are calculated using the hidden layer's neuron values as inputs.

Diese neue verborgene Schicht ermöglicht es unserem Modell, die Eingangsdaten mithilfe eines anderen Parametersatzes neu zu kombinieren. Kann dies unserem Modell helfen, nichtlineare Zusammenhänge zu erlernen?

Übung 2

Wir haben dem Modell eine versteckte Schicht mit vier Neuronen hinzugefügt.

Klicken Sie auf die Schaltfläche „Play“ (▶️) oberhalb des Netzwerks, um den Wert der vier Knoten der verborgenen Schicht und des Ausgabeknotens für die Eingabewerte $x_1 = 1.00$, $x_2 = 2.00$ und $x_3 = 3.00$ zu berechnen.

Erkunden Sie anschließend das Modell und nutzen Sie es, um die folgenden Fragen zu beantworten.

Wie viele Parameter (Gewichte und Bias) hat dieses neuronale Netzwerkmodell?
4
Unser ursprüngliches Modell aus Aufgabe 1 hatte vier Parameter: w 11 , w 21 , w 31 , und b. Da dieses Modell eine verborgene Schicht enthält, gibt es mehr Parameter.
12
Note 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.
16
Beachten Sie, dass die Gesamtzahl der Parameter sowohl die Gewichtungsparameter als auch die Bias-Parameter umfasst.
21
There 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.

Try modifying the model parameters, and observe the effect on the hidden-layer node values and the output value (you can review the Calculations panel below to see how these values were calculated).

Kann dieses Modell Nichtlinearitäten erlernen?

Ja
Klicken Sie auf jeden Knoten in der verborgenen Schicht und auf den Ausgabeknoten und überprüfen Sie die folgenden Berechnungen. Was fällt Ihnen an diesen Berechnungen auf?
NEIN

Wenn Sie auf jeden der Knoten in der verborgenen Schicht klicken und die unten stehenden Berechnungen überprüfen, werden Sie feststellen, dass alle linear sind (bestehend aus Multiplikations- und Additionsoperationen).

If you then click on the output node and review the calculation below, you'll see that this calculation is also linear. Linear calculations performed on the output of linear calculations are also linear, which means this model cannot learn nonlinearities.