A Distributed Learning Algorithm for Communication Development

Matlab(R) implementation of the algorithm

This page provides Matlab(R) code that implements the algorithm for communication development described in the following article:

De Jong, E.D. and L. Steels (2004). A Distributed Learning Algorithm for Communication Development. Complex Systems, vol. 14, no. 4.

This appendix is also available as a single tar file: appendix.tar (100K).

Contents:
Running the algorithm
Output
Help information
File list
Sample output
References
Contact information

Running the algorithm
The algorithm can be run by starting Matlab(R) from the directory containing this distribution and typing

cycle(nosteps, [, temp [, seed] ]);

where nosteps is the number of time steps for which the algorithm will be run, the temperature parameter regulates the degree of exploration, and seed is a parameter specifying the random seed (the default is zero). The second and third parameters are optional. For example, to run the algorithm for 1,000 cycles, type:

cycle(1000);

To specify the temperature, use:

cycle(1000, 0.15);

And to additionally specify the random seed:

cycle(1000, 0.15, 17);

Output
As output, the algorithm displays the understanding matrix at the end of the run and the values of the three measures: specificity, consistency, and fidelity. The understanding matrix specifies, for each pair of referents (ri, rj), the average probability that when referent ri is encoded by an agent and decoded by another agent, the result is referent rj. For successful communication, this matrix should be close to the identity matrix. The fidelity measure is the average of the diagonal of this matrix. Furthermore, a graph of the average fidelity over time is plotted.

Online Matlab(R) help information
To get help on any of the functions, type Help function-name in Matlab(R), e.g. Help cycle. Alternatively, one can inspect the file directly (see list below). The algorithm corresponds directly to the pseudocode described in the paper. The files contain commentary so that, in combination with background information in the article, variations of the algorithm may be explored. The main function is cycle. It follows the description in the article, and contains comments that explain its workings.

File list
boltz.m
compute_frequencies.m
consistency.m
cycle.m
determine_meaning_from_sensors.m
determine_meaning_from_words.m
fidelity.m
initialize_concepts.m
initialize_words.m
logdata.m
relprob.m
select.m
specificity.m
update_spec.m
update_use.m
word_production.m

Sample output
First, we run the algorithm once for 1,000 time steps. This is done with the command cycle(1000);. The output should be the following:

understanding =

0.9961 0.0013 0.0014 0.0013
0.0013 0.9962 0.0013 0.0013
0.0013 0.0013 0.9960 0.0014
0.0013 0.0013 0.0013 0.9962

specificity_measure =

0.9786

consistency_measure =

0.9786

fidelity_measure =

0.9961

The resulting understanding matrix approaches the identity matrix. This indicates that when an agent encodes a referent into a word and another agent decodes this word back into a referent, the result will be the same referent in the vast majority of cases. The average of the diagonal of this matrix, is the fidelity measure, which in this case equals 0.9961.

Other measures can be obtained by monitoring the production matrices P(w|r) (avgpwr) and P(r|w) (avgprw), which are computed in the function logdata.m, and calculating the relevant measures. The contents of these matrices at the end of the run are provided as output of cycle.m, and can be accessed as follows:

[avgpwr,avgprw,avgprr] = cycle(1000);

Functions calculating the measures are provided, and can be used as follows:

specificity(avgprw)
consistency(avgpwr)
fidelity(avgprr)

As an example, let us assume the following randomly generated production matrix: avgpwr =

pwr =

0.158 0.203 0.188 0.451
0.016 0.093 0.779 0.112
0.041 0.013 0.533 0.413
0.128 0.420 0.360 0.093

Then the consistency is obtained by typing consistency(avgpwr), which in this example returns 0.2571, indicating relatively low consistency. To let the communication system converge towards perfect communication, an annealing schedule can be used in which exploration gradually decreases.

The following graph shows the average fidelity over 100 runs of the algorithm:

References
De Jong, E.D. and L. Steels (2004). A Distributed Learning Algorithm for Communication Development. Complex Systems, vol. 14, no. 4.

Contact information
For more information, see Edwin de Jong's homepage, or send email to: d e j o n g @ c s . u u . n l