30 Chapter 7. Results and discussiontensity M c = 1 and 2 s duration, presented every 16 s for 3 hours, followed by an absenceof the stimulus for 10000 s, and then repeated presentation every 16 s for 4300 s. Theoutputs of the tra<strong>in</strong><strong>in</strong>g data set were reconstructed from [53], and can be seen (later on) <strong>in</strong>Figs. 7.3 and 7.5.For this model, two different approaches were used: (1) an RNN, and (2) a habituationmodel based on leaky <strong>in</strong>tegrators. Both models were optimized, parametrically and structurally,by means of an EA. The fitness measure was, <strong>in</strong> both cases, taken as f = 1/e,where e is the root mean squared error (RMSE) over the data set dur<strong>in</strong>g periods ofstimulus presentation 1 :e = 1 ∑√ N (o(i) − y(i)) 2 , (7.3)Ni=1where o(i) represents the i:th measured response, and y(i) the correspond<strong>in</strong>g responsefrom the model. On the occurrence of a stimulus the output from the habituation unit, theresponse strength, s, is related to the probability of a stimulus evok<strong>in</strong>g a response [53].To ensure a valid range of the response probability, p B2 , regardless of habituation model,the follow<strong>in</strong>g conversion was carried out:⎧⎨ s, 0 ≤ s ≤ 1,p B2 = 0, s < 0,(7.4)⎩1, s > 1.Activation of the AC occurs if M c > 0 and p B2 > X, where X is a random variabledrawn from the uniform distribution, X ∼ U(0, 1). In general, the latency depends onstimulus strength, as described <strong>in</strong> Section 3.2.1. However, no such <strong>in</strong>formation was found<strong>in</strong> the literature for <strong>Hydra</strong>’s response to mechanical stimulus, therefore it was set to beconstant. Reset of the AC occurs at completion of the response, which may be a CP or anLP, as described below. The results from each test case of evolv<strong>in</strong>g a habituation unit willnow be described.Test A: Evolv<strong>in</strong>g an RNN to represent habituationAs a first experiment it was tested whether an RNN, parametrically and structurally optimizedby means of an EA to fit experimental data obta<strong>in</strong>ed <strong>in</strong> [53], could represent thehabituation to mechanical stimulus. A cont<strong>in</strong>uous time RNN was used. After apply<strong>in</strong>gEuler’s method for numerical <strong>in</strong>tegration of the network equations, the dynamics of neuroni <strong>in</strong> the network is governed by the follow<strong>in</strong>g equation (see also Appendix B):[ ()]y i (t + ∆t) = y i (t) + ∆tn∑m∑−y i (t) + σ b i + w ij y j (t) + w IτijI j (t) , (7.5)i1 Note that no contribution to the RMSE occurs dur<strong>in</strong>g the recovery period.j=1j=1
7.1. Generation of behaviors 31where b is the bias term, τ the time constant, I the <strong>in</strong>put signal(s), and w and w I are thesynaptic weights from other neurons and <strong>in</strong>put signals, respectively. The <strong>in</strong>tegration timestep, ∆t, was set to 0.2 s. The simulation time step (time between two consecutive <strong>in</strong>putsignals) is 2 s, which gives 10 <strong>in</strong>tegration steps between data po<strong>in</strong>ts used <strong>in</strong> the calculationof Eq. 7.3. A background to the RNNs used here is given <strong>in</strong> Appendix B. The RNN wasevolved us<strong>in</strong>g an EA with the follow<strong>in</strong>g properties (see Appendix A for an explanation ofthe terms): explicit encod<strong>in</strong>g, elitism, no crossover, tournament selection, and structuralas well as parametrical mutations. After an <strong>in</strong>vestigation of various mutation operators,six different operators were used, as described below. The EA properties are summarized<strong>in</strong> Table 7.1.m 1 - Creep mutation: The value of the gene is updated accord<strong>in</strong>g tow new = w old (1 − 2rc + c), where r ∼ U [0, 1] and c is the creep rate. S<strong>in</strong>ce thismutation may generate values outside the allowed range, the gene was scaled <strong>in</strong>toits proper <strong>in</strong>terval us<strong>in</strong>g w → w max if w > w max , and w → w m<strong>in</strong> if w < w m<strong>in</strong> .m 2 - Full-range mutation: The gene is given a new, random value with<strong>in</strong> the allowedparameter <strong>in</strong>terval.m 3 - Add connection mutation: A connection between two units (either between twoneurons, or between an <strong>in</strong>put signal and a neuron) with a randomly chosen synapticweight (with<strong>in</strong> the allowed range), is added.m 4 - Remove connection mutation: Removal of a connection between two units.m 5 - Add neuron mutation: One neuron is added to the RNN (at a randomly chosenlocation). To avoid a macromutation, i.e. a mutation that alters the performance ofthe result<strong>in</strong>g <strong>in</strong>dividual <strong>in</strong> a significant way, the neuron is added with all weightsset to zero (and with randomly selected bias and time constant). Thus, only thepossibility of new connections is established as a result of this mutation operator.m 6 - Remove neuron mutation: Removal of one randomly chosen neuron and all its <strong>in</strong>com<strong>in</strong>gand outgo<strong>in</strong>g connections.In Fig. 7.2, the structure of the best evolved RNN is shown. The network consists of threeneurons and, as can be seen from the network parameters <strong>in</strong> Eq. 7.6, all connections butone <strong>in</strong>put signal connection were established. The evolved RNN performs adequately onthe test data, as can be seen <strong>in</strong> Fig. 7.3. However, its generalization ability to other ISIsand stimulus <strong>in</strong>tensities is poor, an example of which is also shown <strong>in</strong> Fig. 7.3. In general,it should be possible to improve this ability by <strong>in</strong>clud<strong>in</strong>g such stimulus properties <strong>in</strong> thetra<strong>in</strong><strong>in</strong>g data set. However, no such data was found <strong>in</strong> the literature, and it was decided touse another approach rather than creat<strong>in</strong>g a new, somewhat arbitrary data set. As a result,a solution based on a model of habituation was <strong>in</strong>vestigated, which will be described next.