• No se han encontrado resultados

4. El papel del trabajador social sanitario con los inmigrantes en situación irregular

4.3 Propuesta de protocolo de actuación con inmigrantes en situación

Weight assignments on connections between neurons not only indicate the strength of the signal that is being fed for aggregation but also the type of interaction between the two neurons. The type of interaction is one of cooperation or of competition. The cooperative type is suggested by a positive weight, and the competition by a negative weight, on the connection. The positive weight connection is meant for what is called excitation, while the negative weight connection is termed an inhibition.

C++ Neural Networks and Fuzzy Logic:A Survey of Neural Network Models Initialization of Weights

Initializing the network weight structure is part of what is called the encoding phase of a network operation. The encoding algorithms are several, differing by model and by application. You may have gotten the impression that the weight matrices used in the examples discussed in detail thus far have been arbitrarily determined; or if there is a method of setting them up, you are not told what it is.

It is possible to start with randomly chosen values for the weights and to let the weights be adjusted appropriately as the network is run through successive iterations. This would make it easier also. For example, under supervised training, if the error between the desired and computed output is used as a criterion in adjusting weights, then one may as well set the initial weights to zero and let the training process take care of the rest. The small example that follows illustrates this point.

A Small Example

Suppose you have a network with two input neurons and one output neuron, with forward connections between the input neurons and the output neuron, as shown in Figure 5.2. The network is required to output a 1 for the input patterns (1, 0) and (1, 1), and the value 0 for (0, 1) and (0, 0). There are only two connection weights w1 and w2.

Figure 5.2 Neural network with forward connections.

Let us set initially both weights to 0, but you need a threshold function also. Let us use the following threshold function, which is slightly different from the one used in a previous example:

1 if x > 0

f(x) =

{

0 if x ≤ 0

C++ Neural Networks and Fuzzy Logic:A Survey of Neural Network Models

The reason for modifying this function is that if f(x) has value 1 when x = 0, then no matter what the weights are, the output will work out to 1 with input (0, 0). This makes it

impossible to get a correct computation of any function that takes the value 0 for the arguments (0, 0).

Now we need to know by what procedure we adjust the weights. The procedure we would apply for this example is as follows.

• If the output with input pattern (a, b) is as desired, then do not adjust the weights. • If the output with input pattern (a, b) is smaller than what it should be, then

increment each of w1 and w2 by 1.

• If the output with input pattern (a, b) is greater than what it should be, then

subtract 1 from w1 if the product aw1 is smaller than 1, and adjust w2 similarly.

Table 5.9 shows what takes place when we follow these procedures, and at what values the weights settle.

Table 5.9Adjustment of Weights

step w1 w2 a b activation output comment

1 0 0 1 1 0 0 desired output is 1; increment both w’s 2 1 1 1 1 2 1 output is what it should be 3 1 1 1 0 1 1 output is what it should be 4 1 1 0 1 1 1 output is 1; it should be 0. 5 subtract 1 from w2 6 1 0 0 1 0 0 output is what it should be 7 1 0 0 0 0 0 output is what it should be 8 1 0 1 1 1 1 output is what it should be file:///H:/edonkey/docs/c/(ebook-pdf)%20-%20mathem..._Neural_Networks_and_Fuzzy_Logic/ch05/093-096.html (3 of 4) [21/11/02 21:57:12]

C++ Neural Networks and Fuzzy Logic:A Survey of Neural Network Models

9 1 0 1 0 1 1 output is what it

should be

Previous Table of Contents Next Copyright © IDG Books Worldwide, Inc.

C++ Neural Networks and Fuzzy Logic:A Survey of Neural Network Models

C++ Neural Networks and Fuzzy Logic

by Valluru B. Rao

M&T Books, IDG Books Worldwide, Inc.

ISBN: 1558515526 Pub Date: 06/01/95

Previous Table of Contents Next

Table 5.9 shows that the network weight vector changed from an initial vector (0, 0) to the final weight vector (1, 0) in eight iterations. This example is not of a network for pattern matching. If you think about it, you will realize that the network is designed to fire if the first digit in the pattern is a 1, and not otherwise. An analogy for this kind of a problem is determining if a given image contains a specific object in a specific part of the image, such as a dot should occur in the letter i.

If the initial weights are chosen somewhat prudently and to make some particular

relevance, then the speed of operation can be increased in the sense of convergence being achieved with fewer iterations than otherwise. Thus, encoding algorithms are important. We now present some of the encoding algorithms.

Initializing Weights for Autoassociative Networks

Consider a network that is to associate each input pattern with itself and which gets binary patterns as inputs. Make a bipolar mapping on the input pattern. That is, replace each 0 by –1. Call the mapped pattern the vector x, when written as a column vector. The transpose, the same vector written as a row vector, is xT. You will get a matrix of order the size of x

when you form the product xxT. Obtain similar matrices for the other patterns you want the network to store. Add these matrices to give you the matrix of weights to be used initially, as we did in Chapter 4. This process can be described with the following equation:

W = ςixixiT

Weight Initialization for Heteroassociative Networks

Consider a network that is to associate one input pattern with another pattern and that gets binary patterns as inputs. Make a bipolar mapping on the input pattern. That is, replace

C++ Neural Networks and Fuzzy Logic:A Survey of Neural Network Models

each 0 by –1. Call the mapped pattern the vector x when written as a column vector. Get a similar bipolar mapping for the corresponding associated pattern. Call it y. You will get a matrix of size x by size y when you form the product xyT. Obtain similar matrices for the

other patterns you want the network to store. Add these matrices to give you the matrix of weights to be used initially. The following equation restates this process:

W = ςixiyiT

Documento similar