ВУЗ: Не указан

Категория: Не указан

Дисциплина: Не указана

Добавлен: 13.06.2025

Просмотров: 4202

Скачиваний: 0

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.

Backpropagation

'win1,1 = diffhid 1 · o(nin 1)

= 0.077 · 1.0 = 0.077

'win2,1 = diffhid 1 · o(nin 2)

= 0.077 · 0.5 = 0.039

and so on for the remaining weights. The first two updated weights will therefore be:

in1,1 = win1,1 + 'win1,1 = 0.2 + 0.077 = 0.28 w´in2,1 = win2,1 + 'win2,1 = 0.3 + 0.039 = 0.34

The backpropagation procedure iterates until a certain termination criterion has been fulfilled. This could be a fixed number of iterations over all training patterns, or until sufficient convergence has been achieved, for example if the total output error over all training patterns falls below a certain threshold.

Bias neurons Program 19.2 demonstrates the implementation of the backpropagation process. Note that in order for backpropagation to work, we need one additional input neuron and one additional hidden neuron, called “bias neurons”. The activation levels of these two neurons are always fixed to 1. The weights of the connections to the bias neurons are required for the backpropagation procedure to converge (see Figure 19.7).

1

1

input layer

hidden layer

output layer

Figure 19.7: Bias neurons and connections for backpropagation

287


19 Neural Networks

19.4 Neural Network Example

7-segment display

A simple example for testing a neural network implementation is trying to learn the digits 0..9 from a seven-segment display representation. Figure 19.8 shows the arrangement of the segments and the numerical input and training output for the neural network, which could be read from a data file. Note that there are ten output neurons, one for each digit, 0..9. This will be much easier to learn than e.g. a four-digit binary encoded output (0000 to 1001).

1

digit 0

in: 1 1 1 0 1 1 1

out: 1 0 0 0 0 0 0 0 0 0

digit 1

in: 0 0 1 0 0 1 0

out: 0 1 0 0 0 0 0 0 0 0

2

3

digit 2

in: 1 0 1 1 1 0 1

out: 0 0 1 0 0 0 0 0 0 0

digit 3

in: 1 0 1 1 0 1 1

out: 0 0 0 1 0 0 0 0 0 0

digit 4

in: 0 1 1 1 0 1 0

out: 0 0 0 0 1 0 0 0 0 0

4

digit 5

in: 1 1 0 1 0 1 1

out: 0 0 0 0 0 1 0 0 0 0

5

6

digit 6

in: 1 1 0 1 1 1 1

out: 0 0 0 0 0 0 1 0 0 0

digit 7

in: 1 0 1 0 0 1 0

out: 0 0 0 0 0 0 0 1 0 0

digit 8

in: 1 1 1 1 1 1 1

out: 0 0 0 0 0 0 0 0 1 0

7

digit 9

in: 1 1 1 1 0 1 1

out: 0 0 0 0 0 0 0 0 0 1

Figure 19.8: Seven-segment digit representation

Figure 19.9 shows the decrease of total error values by applying the backpropagation procedure on the complete input data set for some 700 iterations. Eventually the goal of an error value below 0.1 is reached and the algorithm terminates. The weights stored in the neural net are now ready to take on previously unseen real data. In this example the trained network could e.g. be tested against 7-segment inputs with a single defective segment (always on or always off).

10

9

8

7

6

5

4

3

2

1

0

40

79

118

157

196

235

274

313

352

391

430

469

508

547

586

625

664

703

1

Figure 19.9: Error reduction for 7-segment example

288


Neural Controller

19.5 Neural Controller

Control of mobile robots produces tangible actions from sensor inputs. A controller for a robot receives input from its sensors, processes the data using relevant logic, and sends appropriate signals to the actuators. For most large tasks, the ideal mapping from input to action is not clearly specified nor readily apparent. Such tasks require a control program that must be carefully designed and tested in the robot’s operational environment. The creation of these control programs is an ongoing concern in robotics as the range of viable application domains expands, increasing the complexity of tasks expected of autonomous robots.

A number of questions need to be answered before the feed-forward ANN in Figure 19.4 can be implemented. Among them are:

How can the success of the network be measured?

The robot should perform a collision-free left-wall following.

How can the training be performed?

In simulation or on the real robot.

What is the desired motor output for each situation?

The motor function that drives the robot close to the wall on the left-hand side and avoids collisions.

Neural networks have been successfully used to mediate directly between sensors and actuators to perform certain tasks. Past research has focused on using neural net controllers to learn individual behaviors. Vershure developed a working set of behaviors by employing a neural net controller to drive a set of motors from collision detection, range finding, and target detection sensors [Vershure et al. 1995]. The on-line learning rule of the neural net was designed to emulate the action of Pavlovian classical conditioning. The resulting controller associated actions beneficial to task performance with positive feedback.

Adaptive logic networks (ALNs), a variation of NNs that only use boolean operations for computation, were successfully employed in simulation by Kube et al. to perform simple cooperative group behaviors [Kube, Zhang, Wang 1993]. The advantage of the ALN representation is that it is easily mappable directly to hardware once the controller has reached a suitable working state.

In Chapter 22 an implementation of a neural controller is described that is used as an arbitrator or selector of a number of behaviors. Instead of applying a learning method like backpropagation shown in Section 19.3, a genetic algorithm is used to evolve a neural network that satisfies the requirements.

289

19 Neural Networks

19.6 References

GURNEY, K. Neural Nets, UCL Press, London, 2002

KUBE, C., ZHANG, H., WANG, X. Controlling Collective Tasks with an ALN, IEEE/RSJ IROS, 1993, pp. 289-293 (5)

MINSKY, M., PAPERT, S. Perceptrons, MIT Press, Cambridge MA, 1969

ROSENBLATT, F. Principles of Neurodynamics. Spartan Books, Washington DC, 1962

RUMELHART, D., MCCLELLAND, J. (Eds.) Parallel Distributed Processing, 2 vols., MIT Press, Cambridge MA, 1986

SUTTON, R., BARTO, A. Reinforcement Learning: An Introduction, MIT Press, Cambridge MA, 1998

VERSHURE, P., WRAY, J., SPRONS, O., TONONI, G., EDELMAN, G. Multilevel

Analysis of Classical Conditioning in a Behaving Real World Artifact, Robotics and Autonomous Systems, vol. 16, 1995, pp. 247-265 (19)

ZAKNICH, A. Neural Networks for Intelligent Signal Processing, World Scientific, Singapore, 2003

290


GENETIC ALGORITHMS 20

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. .. .. .. . Evolutionary algorithms are a family of search and optimization tech-

niques that make use of principles from Darwin’s theory of evolution [Darwin 1859] to progress toward a solution. Genetic algorithms (GA) are a prominent part of this larger overall group. They operate by iteratively

evolving a solution from a history of potential solutions, which are manipulated by a number of biologically inspired operations. Although only an approximation to real biological evolutionary processes, they have been proven to provide a powerful and robust means of solving problems.

The utility of genetic algorithms is their ability to be applied to problems without a deterministic algorithmic solution. Certain satisfiability problems in robotic control fall into this category. For example, there is no known algorithm to deterministically develop an optimal walking gait for a particular robot. An approach to designing a gait using genetic algorithms is to evolve a set of parameters controlling a gait generator. The parameters completely control the type of gait that is produced by the generator. We can assume there exists a set of parameters that will produce a suitable walk for the robot and environment – the problem is to find such a set. Although we do not have a way to obtain these algorithmically, we can use a genetic algorithm in a simulated environment to incrementally test and evolve populations of parameters to produce a suitable gait.

It must be emphasized that the effectiveness of using a genetic algorithm to find a solution is dependent on the problem domain, the existence of an optimal solution to the problem at hand, and a suitable fitness function. Applying genetic algorithms to problems that may be solved algorithmically is decidedly inefficient. They are best used for solving tasks that are difficult to solve, such as NP-hard problems. NP-hard problems are characterized by the difficulty of finding a solution due to a large solution search space, but being easy to verify once a candidate solution has been obtained.

For further reading see [Goldberg 1989] and [Langton 1995].

291291

20 Genetic Algorithms

20.1 Genetic Algorithm Principles

Genotype and

phenotype

In this section we describe some of the terminology used, and then outline the operation of a genetic algorithm. We then examine the components of the algorithm in detail, describing different implementations that have been employed to produce results.

Genetic algorithms borrow terminology from biology to describe their interacting components. We are dealing with phenotypes, which are possible solutions to a given problem (for example a simulated robot with a particular control structure), and genotypes, which are encoded representations of phenotypes. Genotypes are sometimes also called chromosomes and can be split into smaller chunks of information, called genes (Figure 20.1).

The genetic operators work only on genotypes (chromosomes), while it is necessary to construct phenotypes (individuals) in order to determine their fitness.

Gene Chromosome

Gene-Pool

Individual

Population

Figure 20.1: Terminology

GA execution The basic operation of a genetic algorithm can be summarized as follows:

1.Randomly initialize a population of chromosomes.

2.While the terminating criteria have not been satisfied:

a.Evaluate the fitness of each chromosome:

i.Construct the phenotype (e.g. simulated robot) corresponding to the encoded genotype (chromosome).

ii.Evaluate the phenotype (e.g. measure the simulated robot’s walking abilities), in order to determine its fitness.

b.Remove chromosomes with low fitness.

c.Generate new chromosomes, using certain selection schemes and genetic operators.

The algorithm can start with either a set of random chromosomes, or ones that represent already approximate solutions to the given problem. The gene pool is evolved from generation to generation by a set of modifying operators and a selection scheme that depends on the fitness of each chromosome. The

292