Parameter Details
The following table
explains evolutionary parameters available in ANJI, along with recommended settings.
This table lists generic parameters used by all domains. Parameters specific
to particular domains are listed in additional tables below.
Parameter |
Explanation |
Recommended Settings |
random.seed (int) |
Starting
point for the creation of random numbers from a random number generator,
allowing the exact replication of runs with random elements. |
Any
valid integer within the accepted range. If
replication of a particular run is not important, omit or comment out
this parameter, and a random seed will be automatically set. |
run.name (string) |
The ID of the run. | If you are carrying out a large number of runs, you'll probably want to use something like a domain description and date, e.g. "xor082005". |
run.reset (boolean) |
Determines whether or not a run is being continued or whether all persisted data from the previous run is wiped out and the run is started from scratch. | "true" if you want to restart a run, "false" if not. |
num.generations |
The
number of generations to carry out for a run. |
50 to 500 |
popul.size |
The
number of individuals in the starting population, and each generation
after reproduction is carried out. |
50 to 1000 |
topology.mutation.classic (boolean) |
ANJI differs
from the author's original implementation of NEAT in how it handles topological
mutations. In short, ANJI's mutation rates are the the rate at which new
topological mutations arise among all possible locations where a legal
mutation could occur (e.g., since add node mutations can only occur
where there are existing connections, if there are 1000 connections in the
population, with an add node mutation rate of 0.01 you'll get approximately 10 new node mutations). The original NEAT mutation rate indicates the probability of a given individual being mutated. An individual receives, at most, one topological mutation per generation. |
The default setting is "false", which handles mutations as described. If you wish to more closely model NEAT's original implementation, set to "true". |
add.connection. |
The
probability of new connections being added (dependent upon how topology.mutation.classic is set).
Their initial weights will be a random value from a normal distribution. |
0.0001 to 0.5 |
remove.connection. |
The
rate at which existing connections within the range of the remove.connection.max.weight
parameter are removed. All weights
falling within that range are sorted in ascending order of weight magnitude.
|
0.01 to 0.3 |
remove.connection. |
The
magnitude of the weights to be removed by the remove connection operator. If this value is set at 1, only weights between
–1 and 1 will be removed. Those
weights will be sorted in ascending order by magnitude and deleted according
to the remove.connection.mutation.rate |
1 to 500 |
remove.connection.strategy |
Strategy for remove connection mutation. Possible values: |
skewed |
add.neuron.mutation.rate |
The
probability of new nodes being added.
A node can only mutate at an existing connection. |
0.0001 to 0.5 |
prune.mutation.rate |
As
connections are removed, some nodes may become stranded (i.e., not connected
to the rest of the network). This parameter determines the rate at which
stranded nodes are removed from the chromosome. |
|
weight.mutation.rate |
The
probability of existing connection weights being mutated by adding a random
value from the range of the weight.mutation.std.dev. |
0.5 to 0.8 |
weight.mutation.std.dev |
The
standard deviation for weight mutation values.
E.g., if this parameter is set to 2, connection weights will be
mutated by adding a random double generated from a random normal distribution with standard deviation 2.
|
1.0 to 2 |
weight.max |
The
upper bound for connection weight values |
1.0 to 500 |
weight.min |
The
lower bound for connection weight values |
-1.0 to -500 |
survival.rate |
The
percentage of the population which survives and reproduces each generation,
determined by fitness values sorted in descending order |
0.1 to 0.5 |
selector.elitism |
Fittest
individuals from species at least the size defined by the selector.elitism.min.specie.size
parameter are copied unchanged into the next generation |
true |
selector.roulette |
Determines whether or not roulette selection is used. | false |
selector.elitism. |
Minimum
number of individuals a specie must contain for its fittest member to
be copied unchanged into the next generation |
1 to 5 |
chrom.compat.excess.coeff |
Coefficient
used to determine the genetic difference between two chromosomes. This
parameter adjusts the compatibility value based on the number of excess
genes. |
1.0 |
chrom.compat.disjoint.coeff |
Coefficient
used to determine the genetic difference between two chromosomes. This
parameter adjusts the compatibility value based on the number of disjoint
genes. |
1.0 |
chrom.compat.common.coeff |
Coefficient
used to determine the genetic difference between two chromosomes. This
parameter adjusts the compatibility value based on the differences in
the values of common connection weights. |
0.4 |
speciation.threshold |
The
compatibility threshold used to determine whether two individuals belong
to the same species. |
0.1 to 1.0 |
stimulus.size |
Number
of input nodes for initial neural network topology |
Dependent upon domain |
response.size |
Number
of output nodes for initial neural network topology. |
Dependent upon domain |
fitness_function.class |
The
class used to determine the fitness of the evolving population. |
|
fitness.function.adjust. |
Allows
for an explicit fitness penalty to be applied to a chromosome based on
its size. This value is multiplied by the chromosome size and subtracted
from the fitness value after evaluation by the fitness function. |
|
fitness.threshold
(double) |
A chromosome
is considered to have “solved” the problem presented by the
fitness function if its fitness exceeds this value. The number of chromosomes
satisfying this criteria is logged. |
Dependent
upon domain |
fitness.target
(double) |
As soon as
the fitness of a chromosome exceeds this target, the evolutionary run ends. |
Dependent
upon domain |
initial.topology.activation |
Determines the activation function of hidden nodes in the network. Supported values are: linear, sigmoid, evsail-sigmoid, tanh, tanh-cubic, step, and signed. | sigmoid |
initial.topology.activation.input |
Determines the activation function of input nodes in the network. Supported values are: linear, sigmoid, evsail-sigmoid, tanh, tanh-cubic, step, and signed. | linear |
initial.topology.activation.output |
Determines the activation function of output nodes in the network. Supported values are: linear, sigmoid, evsail-sigmoid, tanh, tanh-cubic, step, signed, clamped-linear, and signed-clamped-linear. | sigmoid |
initial.topology. |
Determines whether or not the initial topologies begin with all input nodes being fully connected (with feedforward connections only) to all output nodes. If set to "false" there will be no connections at all in the intial topology. | true |
initial.topology.num. |
Number of hidden nodes in the starting topologies. If this value is greater than zero, all input nodes will be fully connected to the number of hidden nodes (with feedforward connections only). These hidden nodes will then be fully connected to all output nodes. | false |
recurrent |
Policy for
handling recurrent connections. Supported values:
disallowed: mutations that would cause a loop in the network are not allowed. best_guess: based on a layer-based approximation of the network topology, connections that potentially could cause recurrent loops cache values from the previous activation to avoid deadlock. lazy:
all connections cache values from the previous activation. |
Dependent
upon domain |
recurrent.cycles |
Number of cycles a network with recurrency is activated after receiving input before the output values are read. | 1 |
ann.type |
Determines the neural network framework the transcribers use to build networks from chromosomes. Currently only one framework exists, but plans for other network implementations will be included in later releases. | anji |
persistence.class |
Java class used to persist data, including chromosomes and run summary. Implements com.anji.persistence.Persistence. | com.anji.persistence. FilePersistence |
persistence.base.dir |
Directory path to base directory under which all persistence data is stored. | ./db |
persist.all |
If true, stores all chromosomes. | false |
persist.champions |
If true, stores the fittest individuals from each generation. | true |
persist.last |
If true, stores all individuals from the final generation. | true,
if you wish to continue a run |
id.file |
Full path to file which persists chromosome ids for a given run. | ./db/id.xml |
neat.id.file |
Full path to file which persists innovation ids for topological features for a given run. | ./db/neatid.xml |
presentation.dir |
Directory where xml related to visual presentation (e.g., complexity, fitness, and speciation) is stored. | ./nevt |
log4j.* |
Logging parameters. See log4j for details. | Suggested defaults in xor.properties |
XOR and other fitness
functions with target output values
The following are parameters specific to XOR or any fitness function in which there are target values for specific inputs.
Parameter |
Explanation |
Recommended Settings |
targets.range (double) |
For
fitness functions based on comparing the neural net output to target values,
any value whose distance to its target is less than targets.range is considered
to have an error of 0. |
0.0
to 0.5 |
stimuli.file
(path) |
Path to a
file (relative to CLASSPATH) containing the stimuli used in the fitness
function (not required for all fitness functions). A row contains a single
activation, and the file contains a sequence of activations. Rows separated
by semi-colons and columns separated by new line characters. |
Dependent
upon domain |
targets.file
(path) |
Path to a
file (relative to CLASSPATH) containing the targets used in the fitness
function (not required for all fitness functions). A row contains a single
target output, and the file contains a sequence of activations. Rows separated
by semi-colons and columns separated by new line characters. |
Dependent
upon domain |
Game Domains
The following are parameters specific to fitness functions based on tournament and game play.
Parameter |
Explanation |
Recommended Settings |
tournament.class |
The class used to determine the tournament structure. ANJI currently supports:
com.anji.tournament.DirectTournament |
Dependent
upon domain |
tournament.direct.opponents (string) |
Defines hand-coded external players (see ttt.properties for examples) | Dependent
upon domain |
tournament.fitness.max (int) |
For visualization only, this value scales fitness values between 0 and this value for display purposes. | 100000 |
tournament.win.value (int) |
Value of each win. | 1 |
tournament.loss.value (int) |
Value of each loss. | -1 |
tournament.tie.value (int) |
Value of each tie. | 0 |
tournament.transcriber. class (string) |
Transcribes the chromosome into a neural network, which is then wrapped by a player object (e.g. TTTPlayerTranscriber). | Dependent
upon domain |
tournament.transcriber. ttt.player.type (string) |
Type
of Tic-Tac-Toe player. Valid values are: default - Player has 9 inputs (plus bias makes 10) and 9 outputs, one for each board position. The maximum of these outputs determines the next move. 9x1 - Player has 9 inputs (plus bias makes 10) and 1 output. This player treats the network as a board state evaluator, passing every possible next board state to the net and taking the one with the highest affinity output. rotating - Same as default, except the neural network is shown the same board 4 times, with the board rotated 0, 90, 180, and 270 degrees. |
default |
tournament.component (string) |
Component game (where a game might be a single game, a set of games, a match, etc..) of the tournament. The value of this property is a prefix for all the properties of the component game, including its class. For example, if tournament.component=match, then there should be a property match.class whose value is a subclass of com.anji.tournament.Game. See sample properties files, such as ttt.properties and gomoku.properties, for details. | match |
<component>. class (string) |
Value is a Java class, a subclass of com.anji.tournament.Game. If this component in turn has subcomponent games, its value should be com.anji.tournament.IteratedGame. Otherwise it should be an atomic game, such as com.anji.gomoku.GomokuGame. | Dependent
upon domain |
<component>. players.reset (boolean) |
Set to true if the players should be reset (i.e., their memories erased) before each iteration of this game component. | Dependent
upon domain |
<component>. log (boolean) |
Set to true if results of this game component should be written to the log. | Dependent
upon domain |
<component>. component.count (int) |
Number of iterations of the component game to play. | Dependent
upon domain |
<component>. component (string) |
This is only valid if <component>.class=com.anji.tournament.IteratedGame. It specifies the component game of this iterated game (which might itself be another iterated game). In this way the component game hierarchy is recursive. | Dependent
upon domain |
Pole Balancing
The following are parameters specific to fitness functions dealing with pole balancing.
Parameter |
Explanation |
Recommended Settings |
polebalance.input.velocities (boolean) |
If
set to true, inputs velocity values into neural network.
In this case, stimulus.size must be set to 7. If set
to false, does not input velocities. In this case, stimulus.size
must be set to 4. |
Dependent
upon domain |
penalize.for.energy.use
(boolean) |
If set to true penalizes fitness proportionate to the amount of movement of the cart. Meant to penalize solutions that would be untenable in a real-world situation. | Dependent
upon domain |
penalize.oscillations (boolean) |
Penalizes oscillating movement to discourage simple oscillating solutions. | Dependent
upon domain |
polebalance.track.length (double) |
Length of track. | 4.8 |
polebalance.timesteps (int) |
Number of time steps for trial. | 10000 |
polebalance.trials (int) |
Number of trials . | 1 |
polebalance.angle.threshold
(double) |
The maximum magnitude for the angle of either pole. If either pole reaches an angle greater than this threshold, the trial ends in failure. The neural net inputs representing pole angles (in radians) are divided by this value, yielding a scaled input ranging from -1 to 1. | 0.628329 |
polebalance.pole.angle.start.random (boolean) |
If true, poles begin each trial in a random position, which is determined by the polebalance.pole.angle.start.* parameters. | false |
polebalance.pole.angle.start.* (double) |
Defines the standard deviation of a normal distribution for the random starting position of each pole. | 0.07 |
pole.*.length (double) |
Determines the length of each pole. | 1
and 0.1 respectively. The closer the values are, the more difficult the
problem is to solve. |
Active Vision System Properties
The following are parameters specific to fitness functions using the active vision system (or "roving eye") in ANJI. For now, the only experiments carried out with this system involved evolving networks that distinguished between two sets of images, e.g., circles and squares.
Parameter |
Explanation |
Recommended Settings |
image.matches (path) |
The
path to the directory containing images which should evoke a positive
output when viewed. |
./images/matches |
image.mismatches (path) |
The path to the directory containing images which should evoke a negative output when viewed. | ./images/mismatches |
image.randomize (boolean) |
Determines whether or not the images in the matches and mismatches directories are transformed randomly before being viewed by the active vision system. | true |
image.randomize. matches.count (int) |
Number of random transforms of the images in the matches directory. | Dependent
upon domain |
image.randomize. mismatches.count (int) |
Number of random transforms of the images in the mismatches directory. | Dependent
upon domain |
image.randomize. matches.originals (path) |
Path where the original match images reside. If images are randomized, they will be placed in the image.matches directory. | ./images/original_matches |
image.randomize. mismatches.originals (path) |
Path where the original mismatch images reside. If images are randomized, they will be placed in the image.mismatches directory. | ./images/original_matches |
image.randomize.x (int) |
Number of pixels randomized images can be transformed horizontally (e.g., if this value is 20, randomized images will be moved up to 20 pixels either left or right). | 10-50 |
image.randomize.y (int) |
Number of pixels randomized images can be transformed vertically. | 10-50 |
image.randomize. scale (double) |
Percentage of scale change in randomized images (e.g. if this value is 0.2, randomized images will be up to 20% smaller or larger). | 0.1
- 0.5 |
image.randomize. rotate (int) |
Number of degrees that a randomized image can be rotated either clockwise or counterclockwise. | 10
- 180 |
image.randomize. crop.size (int) |
The height and width of the resulting randomized image. | Dependent
upon original image sizes |
eye.eval.frinks (int) |
The amount of processing given to the active vision system to evaluate a single image. Smaller networks are given more time, and larger ones less time, in order to reward more efficient topologies. | 5
- 20 |
eye.flip.enabled (boolean) |
If true, allows the active vision system to toggle to a mirror view and back of the image it is viewing. | Dependent
upon domain |
eye.max-per-step.x (double) |
The furthest distance the active vision system can move horizontally during a single time step. This value is a percentage of the canvas width (e.g., with a canvas 100 pixels wide, with this parameter set to 0.2, the active vision system can move a maximum of 20 pixels per time step). | 0.01
- 1 |
eye.max-per-step.y (double) |
The furthest distance the active vision system can move vertically during a single time step. This value is a percentage of the canvas height. | 0.01
- 1 |
eye.max-per-step.z (double) |
The most the active vision system can zoom in or out on a given time step. This value is a percentage of the canvas size. | 0.01
- 1 |
eye.max-per-step.theta (double) |
The most degrees the active vision system can rotate either clockwise or counterclockwise during a given time step. This value is a percentage of 360 degrees (e.g., with a value of 0.1, the eye can rotate up to 36 degrees either way on a given time step). | 0.01
- 1 |
eye.zoom.start (double) |
The zoom factor at which the active vision system begins viewing the image. | 0.5 |
eye.display (boolean) |
If set to true, will display the movement of the eye as it scans images. | For
evolution false; for analysis of eye's behavior true. |
eye.step.sleep.millis (int) |
For visualization purposes only, this parameter sets the amount of time elapsed between each step that the eye takes. | 0
for evolution; 100 - 1000 for visualization |
eye.surface.class (Java class) |
The class for the type of surface to be viewed. | com.anji.imaging.Java2DSurface |
surface.transformer.class (Java class) |
Determines how images are translated into values for input into the neural network. | com.anji.imaging. DefaultBufferedImageTransformer |
image.transform. interpolation.type (int) |
Determines
the interpolation type for the image transformer. 1 = Nearest Neighbor 2 = Bilinear 3 = Bicubic |
1 |