Class AMALGAMSpecies
- All Implemented Interfaces:
Prototype,Setup,Serializable,Cloneable
AMALGAMSpecies must be used in combination with AMALGAMBreeder, which will call it at appropriate times to revise the distribution and to generate a new subpopulation of individuals. Unlike CMA-ES, AMALGAM does not require its own special initializer (we use SimpleInitializer).
AMALAGAMSpecies has nine numeric parameters that you can set; five of them have standard default constant values, and four have values which, if you don't specify them, are updated every step via excessively complex equations.
AMALGAMSpecies also has an "alternative termination" option, by default turned off. Normally ECJ terminates when the optimal individual is discovered or when the generations or maximum number of evaluations has been exceeded. AMALGAM will also terminate when the "distribution multiplier" is lower than 10^(-10), or when the distribution variance is less than the fitness variance tolerance.
AMALGAMSpecies relies on the EJML matrix library, available at http://ejml.org/
Parameters
| base.tau 0 <= Floating-point value <= 1 |
(proportion of elite individuals) If not provided, defaults to 0.35 |
| base.variance-tolerance 0 <= Floating-point value |
(termination condition: if the variance is less than this amount) If not provided, defaults to 0.0 |
| base.nis-max 0 <= Floating-point value |
(number of generations with no improvement beyond which the distribution multiplier begins to decrease) If not provided, defaults to 25 + genome size |
| base.alpha-ams 0 < Floating-point value |
(the proportion of individuals to be shifted in the direction of the anticipated mean shift) If not provided, defaults to 0.5 * tau * subpopulation size / (subpopulation size - 1) |
| base.delta-ams 0 < Floating-point value |
(controls how much selected individuals are shifted) If not provided, defaults to 2.0 |
| base.eta-shift 0 <= Floating-point value <= 1 |
(learning rate of the anticipated mean shift) If not provided, defaults to 1.0 - (e ^ (-1.2 * (floor(tau * subpopulation size))^0.31) / (genome size ^ 0.5)) |
| base.eta-sigma 0 <= Floating-point value <= 1 |
(learning rate of the covariance matrix) If not provided, defaults to 1.0 - e ^ (-1.1 * (floor(tau * subpopulation size)^1.20) / (genome size ^ 1.6)) |
| base.eta-dec 0 <= Floating-point value <= 1 |
(degree to which the distribution multipler is decreased in certain conditions) If not provided, defaults to 0.9 |
| base.theta-sdr 0 <= Floating-point value |
(threshold for the standard deviation ratio) If not provided, defaults to 1.0 |
| base.alternative-termination boolean, default false |
Should we also terminate on AMALGAM's additional termination conditions?. |
Default Base
eda.amalgam.species
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionorg.ejml.data.DenseMatrix64Fdoubleorg.ejml.data.DenseMatrix64Forg.ejml.data.DenseMatrix64Fdoubledoubledoubledoubledoubledoublebooleandoubleorg.ejml.data.DenseMatrix64Fintorg.ejml.data.DenseMatrix64FThe mean of the distribution.org.ejml.data.DenseMatrix64Fintstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final intstatic final Stringstatic final Stringstatic final Stringorg.ejml.data.DenseMatrix64Fdoubledoubleorg.ejml.data.DenseMatrix64Forg.ejml.data.DenseMatrix64Forg.ejml.data.DenseMatrix64Forg.ejml.data.DenseMatrix64Fbooleandoubledoubledoubleorg.ejml.data.DenseMatrix64FFields inherited from class ec.vector.FloatVectorSpecies
C_GAUSS_MUTATION, C_INTEGER_RANDOM_WALK_MUTATION, C_INTEGER_RESET_MUTATION, C_POLYNOMIAL_MUTATION, C_RESET_MUTATION, DEFAULT_OUT_OF_BOUNDS_RETRIES, gaussMutationStdev, maxGene, minGene, mutationDistributionIndex, mutationIsBounded, mutationType, outOfBoundsRetries, P_MAXGENE, P_MINGENE, P_MUTATION_BOUNDED, P_MUTATION_DISTRIBUTION_INDEX, P_MUTATIONTYPE, P_OUTOFBOUNDS_RETRIES, P_POLYNOMIAL_ALTERNATIVE, P_RANDOM_WALK_PROBABILITY, P_STDEV, polynomialIsAlternative, randomWalkProbability, V_GAUSS_MUTATION, V_INTEGER_RANDOM_WALK_MUTATION, V_INTEGER_RESET_MUTATION, V_POLYNOMIAL_MUTATION, V_RESET_MUTATIONFields inherited from class ec.vector.VectorSpecies
C_ANY_POINT, C_GEOMETRIC, C_INTERMED_RECOMB, C_LINE_RECOMB, C_NONE, C_ONE_POINT, C_ONE_POINT_NO_NOP, C_SIMULATED_BINARY, C_TWO_POINT, C_TWO_POINT_NO_NOP, C_UNIFORM, chunksize, crossoverDistributionIndex, crossoverProbability, crossoverType, duplicateRetries, dynamicInitialSize, genomeIncreaseProbability, genomeResizeAlgorithm, genomeSize, lineDistance, maxInitialSize, minInitialSize, mutationProbability, P_CHUNKSIZE, P_CROSSOVER_DISTRIBUTION_INDEX, P_CROSSOVERPROB, P_CROSSOVERTYPE, P_DUPLICATE_RETRIES, P_GENOMESIZE, P_GEOMETRIC_PROBABILITY, P_LINEDISTANCE, P_MUTATIONPROB, P_NUM_SEGMENTS, P_SEGMENT, P_SEGMENT_END, P_SEGMENT_START, P_SEGMENT_TYPE, P_UNIFORM_MAX, P_UNIFORM_MIN, P_VECTORSPECIES, V_ANY_POINT, V_GEOMETRIC, V_INTERMED_RECOMB, V_LINE_RECOMB, V_ONE_POINT, V_ONE_POINT_NO_NOP, V_SIMULATED_BINARY, V_TWO_POINT, V_TWO_POINT_NO_NOP, V_UNIFORMFields inherited from class ec.Species
f_prototype, i_prototype, P_FITNESS, P_INDIVIDUAL, P_PIPE, pipe_prototype -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadaptDistributionMultiplier(EvolutionState state, Subpopulation subpop) booleancheckTerminationConditions(EvolutionState state, Subpopulation subpop) clone()Creates a new individual cloned from a prototype, and suitable to begin use in its own evolutionary context.intvoidcomputeAMS(EvolutionState state, Subpopulation subpop) voidcomputeConstraintViolations(EvolutionState state, Subpopulation subpop) voidcomputeCovariance(EvolutionState state, Subpopulation subpop) voidcomputeMean(EvolutionState state, Subpopulation subpop) Returns the default base for this prototype.booleanisValid(DoubleVectorIndividual dvind) newIndividual(EvolutionState state, int thread) Provides a brand-new individual to fill in a population.voidselectForDiversity(EvolutionState state, Subpopulation subpop) voidsetup(EvolutionState state, Parameter base) The default version of setup(...) loads requested pipelines and calls setup(...) on them and normalizes their probabilities.voidshiftIndividual(EvolutionState state, DoubleVectorIndividual ind) voidupdateDistribution(EvolutionState state, Subpopulation subpop) Methods inherited from class ec.vector.FloatVectorSpecies
gaussMutationStdev, inNumericalTypeRange, loadParametersForGene, maxGene, minGene, mutationDistributionIndex, mutationIsBounded, mutationType, outOfRangeRetryLimitReached, polynomialIsAlternative, randomWalkProbabilityMethods inherited from class ec.vector.VectorSpecies
contains, contains, contains, contains, duplicateRetries, fill, fill, fill, fill, initializeGenomeSegmentsByEndIndices, initializeGenomeSegmentsByStartIndices, mutationProbability, setupGenomeMethods inherited from class ec.Species
buildMisc, newIndividual, newIndividual, updateIndividual, updateSubpopulation
-
Field Details
-
P_AMALGAM_SPECIES
- See Also:
-
P_TAU
- See Also:
-
P_ETA_DEC
- See Also:
-
P_THETA_SDR
- See Also:
-
P_ETA_SHIFT
- See Also:
-
P_ETA_SIGMA
- See Also:
-
P_NIS_MAX
- See Also:
-
P_VARIANCE_TOLERANCE
- See Also:
-
P_DELTA_AMS
- See Also:
-
P_ALPHA_AMS
- See Also:
-
P_ALTERNATIVE_TERMINATION
- See Also:
-
P_PARAMETER_MISSING
public static final int P_PARAMETER_MISSING- See Also:
-
useAltTermination
public boolean useAltTermination -
tau
public double tau -
fitnessVarianceTolerance
public double fitnessVarianceTolerance -
maximumNoImprovementStretch
public int maximumNoImprovementStretch -
noImprovementStretch
public int noImprovementStretch -
alphaAMS
public double alphaAMS -
userAlphaAMS
public double userAlphaAMS -
deltaAMS
public double deltaAMS -
etaP
public double etaP -
userEtaP
public double userEtaP -
etaS
public double etaS -
userEtaS
public double userEtaS -
distributionMultiplierDecrease
public double distributionMultiplierDecrease -
distributionMultiplierIncrease
public double distributionMultiplierIncrease -
distributionMultiplier
public double distributionMultiplier -
stDevRatioThresh
public double stDevRatioThresh -
mean
public org.ejml.data.DenseMatrix64F meanThe mean of the distribution. -
prevMean
public org.ejml.data.DenseMatrix64F prevMean -
xAvgImp
public org.ejml.data.DenseMatrix64F xAvgImp -
meanShift
public org.ejml.data.DenseMatrix64F meanShift -
genCovarMatrix
public org.ejml.data.DenseMatrix64F genCovarMatrix -
aggCovarMatrix
public org.ejml.data.DenseMatrix64F aggCovarMatrix -
covarMatrix
public org.ejml.data.DenseMatrix64F covarMatrix -
choleskyLower
public org.ejml.data.DenseMatrix64F choleskyLower -
temp
public org.ejml.data.DenseMatrix64F temp -
temp2
public org.ejml.data.DenseMatrix64F temp2 -
temp3
public org.ejml.data.DenseMatrix64F temp3 -
tempMatrix
public org.ejml.data.DenseMatrix64F tempMatrix -
constraintViolations
-
firstGeneration
public boolean firstGeneration
-
-
Constructor Details
-
AMALGAMSpecies
public AMALGAMSpecies()
-
-
Method Details
-
defaultBase
Description copied from interface:PrototypeReturns the default base for this prototype. This should generally be implemented by building off of the static base() method on the DefaultsForm object for the prototype's package. This should be callable during setup(...).- Specified by:
defaultBasein interfacePrototype- Overrides:
defaultBasein classVectorSpecies
-
setup
Description copied from class:SpeciesThe default version of setup(...) loads requested pipelines and calls setup(...) on them and normalizes their probabilities. If your individual prototype might need to know special things about the species (like parameters stored in it), then when you override this setup method, you'll need to set those parameters BEFORE you call super.setup(...), because the setup(...) code in Species sets up the prototype. -
clone
Description copied from interface:PrototypeCreates a new individual cloned from a prototype, and suitable to begin use in its own evolutionary context.Typically this should be a full "deep" clone. However, you may share certain elements with other objects rather than clone hem, depending on the situation:
- If you hold objects which are shared with other instances, don't clone them.
- If you hold objects which must be unique, clone them.
- If you hold objects which were given to you as a gesture of kindness, and aren't owned by you, you probably shouldn't clone them.
- DON'T attempt to clone: Singletons, Cliques, or Populations, or Subpopulation.
- Arrays are not cloned automatically; you may need to clone an array if you're not sharing it with other instances. Arrays have the nice feature of being copyable by calling clone() on them.
Implementations.
- If no ancestor of yours implements clone(), and you have no need to do clone deeply, and you are abstract, then you should not declare clone().
- If no ancestor of yours implements clone(),
and you have no need to do clone deeply,
and you are not abstract, then you should implement
it as follows:
public Object clone() { try { return super.clone(); } catch ((CloneNotSupportedException e) { throw new InternalError(); } // never happens } - If no ancestor of yours implements clone(), but you
need to deep-clone some things, then you should implement it
as follows:
public Object clone() { try { MyObject myobj = (MyObject) (super.clone()); // put your deep-cloning code here... } catch ((CloneNotSupportedException e) { throw new InternalError(); } // never happens return myobj; } - If an ancestor has implemented clone(), and you also need
to deep clone some things, then you should implement it as follows:
public Object clone() { MyObject myobj = (MyObject) (super.clone()); // put your deep-cloning code here... return myobj; }
-
computeConstraintViolations
-
compareIndividuals
-
isValid
-
newIndividual
Description copied from class:SpeciesProvides a brand-new individual to fill in a population. The default form simply calls clone(), creates a fitness, sets evaluated to false, and sets the species. If you need to make a more custom genotype (as is the case for GPSpecies, which requires a light rather than deep clone), you will need to override this method as you see fit.- Overrides:
newIndividualin classVectorSpecies
-
adaptDistributionMultiplier
-
selectForDiversity
-
computeMean
-
computeCovariance
-
computeAMS
-
updateDistribution
-
checkTerminationConditions
-
shiftIndividual
-