This use case models the evolution of a stimulus-response reflex in an animal population that has not yet evolved modifiable synapses and compares that rate of evolution to that occurring in a later population that has evolved modifiable synapses based on the “just before” criteria. It assumes the first synaptic connections between neurons were unmodifiable, that the initial connection between two neurons would be either excitatory or inhibitory with a specific strength that would not change in the lifetime of the organism. The development of a modifiable synapse is seen as a later product of evolution.
Program Description
The “brain” matrix of this program, unlike most other use cases, represents not a collection of neurons in a single organism but rather the “same” neuron in the nervous system of 10 different individuals of a species. This neuron is assumed to generate a hypothetical behavior that, when emitted, has possible adaptive significance for the species. To use the classical example, salivating when food contacts a tongue. The sensor that detects the potential Unconditioned Stimulus is modeled as a 4 x 4 “bit” detector with binary outputs which are the stimuli sent to the neurons. The synaptic connections between the sensor and each neuron/organism are represented by the brain matrix. A single pattern of activation represents the UCS.
The program models two “worlds.” In both worlds the population of organisms is presented with four instances of the UCS as well as twelve other random stimuli over the course of one “lifetime”. The initially random connections between the sensor and the neurons result in different pattern of responses by each neuron that can be represented by a confusion matrix. Instances of a particular outcome can be assigned arbitrary but relatively meaningful values. For example a true positive, a response by the neuron when the UCS is presented can be given a positive value while a false positive can be given a negative value. These values for each neuron are summed over the course of a lifetime thereby producing a generational “fitness” score for each neuron. The fitness scores are compared and a “genetic” copy of the “best animal” replaces the worst animal, and some random variation is applied to one synapse of each neuron and then the simulation is run for another “generation”. The process is repeated until variation and natural selection produces a pattern of connections in a neuron that functions as a perfect detector, that is, it fires in response to the UCS but not otherwise.
In World=0 there are no modifiable synapses and connections between the sensor and the neurons vary only as the result random variation. World=1 is identical to World=0 except for the fact that when a neuron fires in World=1 it is sent to the “learn” method which implements the standard process of learning. That is whenever a neuron does fire, those non-zero synapses that were just previously activated by the sent stimulus are eligible for modification and their synaptic values are increased.
Unique Details of this Program
No “fixer” is involved. It was assumed that a modifiable synapse, in its earliest incarnation, would only increase with no subsequent decay. This seems reasonable because a single process (increase) seems easier to evolve than a multistep one (e.g., increase, decrease, and “fix”).
A separate “geneBrain” and “brain” were needed to prevent Lamarckian inheritance of changes in the brain produced by learning. That is, the equation behavior = brain * stimulus is implemented as usual but any learning (synaptic changes) produced in World=1 does not get inherited in subsequent generations.
The Neural Network
Sixteen stimuli neurons make random synaptic connections with each of 10 “animal” neurons.
The Matrix Representation
The matrix above shows the “geneBrain” after Animal 0 has evolved a functioning reflex.
The Code
https://github.com/Ondaweb/REFLEXES
Reflex evolution addendum
In order to perform a Monte Carlo simulation of the evolution of a simple stimulus-response reflex we modeled a population of neural circuits representing the connections between a stimulus detector and a last common path effector neuron. The stimulus detector was represented as a 4 x 4 binary encoder that was randomly wired to a single effector neuron. When the effector neuron fires it is held to emit a behavior that, in the presence of the unconditioned stimulus, would result in an adaptive response. Ten such circuits constituted a “population” that were repeatedly presented, over a “lifetime” with random stimuli intermixed with an arbitrary fixed pattern representing the putative UCS. The response of each neuron can be characterized by pattern detection theory as either a true positive, false positive, true negative or false negative. Those outcomes have obvious adaptive values (or costs) and were accordingly scored. The neuron with the highest score was cloned, replacing the neuron with the lowest score thereby simulating a second “generation”. The process is repeated until a neuron fires if and only if the UCS is presented and the number of generations this takes is recorded. The entire process is then repeated a total of 10 times and the average number of generations needed to evolve a functioning reflex is recorded. The entire process is repeated again in a different “world” where a single line of code adds the existence of a modifiable synapse in accordance with the above specifications (albeit no fixers are operating) which therefore allows classical conditioning to occur. A typical result shows it took an average of 260 generations to produce the reflex with modifiable synapses and 6326 without.