Suche

2.1 A human decision

How does a neural “network” consisting of one neuron with only one input and one output learn to make decisions?

If-then rules can be implemented very easily with a computer program. All programming languages have decision statements that can be used to control a program. In Scratch, for example, such a decision instruction can be found in an if/else block.

Neural networks too can make decisions like healthy or sick, young or old, positive or negative, etc. In this section, we will use the example of a “digital bouncer” to illustrate the difference in the ways in which normal computer programs and neural networks make decisions.

In both cases, our digital bouncer only lets people over the age of 18 into his disco. If they are 18 or older, he says yes, otherwise he says no.

The Scratch program

Scratch is a popular programming language for beginners. To demonstrate the difference between a computer program and a neural network, the example will first be shown as a Scratch script. The first image shows the Scratch script and the output of the script after a user has entered their age (14). According to the logic of the program, the correct output is no, as the user is 14 years old and you are only allowed to enter the disco at 18.

Scratch learning

The neural network with the same idea

The neural network in the lower part of the second figure only consists of a single neuron. Initially, it cannot make a correct decision because it has not yet learnt anything – it has not yet been trained or adjusted in the correct way, respectively. If you hover the mouse pointer over the boxes in the upper part of the interactive figure, you will see that with the neuron’s current starting values, only people older than 23 are admitted to the disco.

However, you can “train” it manually by changing the weight and threshold value with a click. It should then be able to make the correct decision and behave like a real digital bouncer.

Instructions

  • Click on the minus or plus signs to change the values for the weight w or the threshold value b.
  • Hover the mouse pointer over the boxes at the top, each of which represents an age: For each box, the neuron's current decision is displayed as to whether you are allowed to enter the disco at that age or not. For each box, the calculation of the neuron is displayed in the lower part.
  • In the upper part, red stands for no and green stands for yes.
Bitte einen anderen Browser benutzen.
Bitte einen anderen Browser benutzen.
Bitte einen anderen Browser benutzen.
Bitte einen anderen Browser benutzen.

Task

Now try to adjust the neuron in such a way that, like a real digital bouncer, it only lets people aged 18 and over into the disco. To do this, change the weight and/or the threshold and then test the neuron by moving the mouse pointer over the boxes in the top row.

If you have managed to get the neuron to function correctly, then you have done exactly what neural networks do during training using their special learning algorithm, i.e. change weights and thresholds until the desired behaviour is achieved.

Close search