Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define how to represent the parameter space and develop an encoder/decoder #4

Open
ajnebro opened this issue Jan 25, 2023 · 0 comments
Labels
priority Priority issue
Milestone

Comments

@ajnebro
Copy link
Contributor

ajnebro commented Jan 25, 2023

The parameter space of an auto-configurable algorithm is composed of parameters and parameter relationships. The parameter has a type, which can be:

  • Real: a real value within a range [upper bound, lower bound]
  • Integer: an integer value within a range [upper bound, lower bound]
  • Cardinal: a list of strings

Our starting point is the parameter space of AutoNSGAII and the configuration file defined to use irace as auto-configuration tool:

populationSize                           "--populationSize "                      o       (100)                                              
#
algorithmResult                          "--algorithmResult "                     c       (externalArchive, population)                      
populationSizeWithArchive                "--populationSizeWithArchive "           i       (10, 200)                      | algorithmResult %in% c("externalArchive")
externalArchive                          "--externalArchive "                     c       (crowdingDistanceArchive, unboundedArchive) | algorithmResult %in% c("externalArchive")
#
createInitialSolutions                   "--createInitialSolutions "              c       (random, latinHypercubeSampling, scatterSearch)                     
#
variation                                "--variation "                           c       (crossoverAndMutationVariation)                     
offspringPopulationSize                  "--offspringPopulationSize "             i       (1, 400)                       | variation %in% c("crossoverAndMutationVariation")
crossover                                "--crossover "                           c       (SBX, BLX_ALPHA, wholeArithmetic) | variation %in% c("crossoverAndMutationVariation")
crossoverProbability                     "--crossoverProbability "                r       (0.0, 1.0)                     
crossoverRepairStrategy                  "--crossoverRepairStrategy "             c       (random, round, bounds)        
sbxDistributionIndex                     "--sbxDistributionIndex "                r       (5.0, 400.0)                   | crossover %in% c("SBX")
blxAlphaCrossoverAlphaValue              "--blxAlphaCrossoverAlphaValue "         r       (0.0, 1.0)                     | crossover %in% c("BLX_ALPHA")
mutation                                 "--mutation "                            c       (uniform, polynomial, linkedPolynomial, nonUniform) | variation %in% c("crossoverAndMutationVariation")
mutationProbabilityFactor                "--mutationProbabilityFactor "           r       (0.0, 2.0)                     
mutationRepairStrategy                   "--mutationRepairStrategy "              c       (random, round, bounds)        
polynomialMutationDistributionIndex      "--polynomialMutationDistributionIndex " r       (5.0, 400.0)                   | mutation %in% c("polynomial")
linkedPolynomialMutationDistributionIndex "--linkedPolynomialMutationDistributionIndex " r       (5.0, 400.0)                   | mutation %in% c("linkedPolynomial")
uniformMutationPerturbation              "--uniformMutationPerturbation "         r       (0.0, 1.0)                     | mutation %in% c("uniform")
nonUniformMutationPerturbation           "--nonUniformMutationPerturbation "      r       (0.0, 1.0)                     | mutation %in% c("nonUniform")
#
selection                                "--selection "                           c       (tournament, random)                               
selectionTournamentSize                  "--selectionTournamentSize "             i       (2, 10)                        | selection %in% c("tournament")

The third column of the list is a character indicating the parameter type: c (cardinal), i (integer), and r (real). The last column indicates explicit parameter relationships (e.g., sbxDistributionIndex depends of whether the SBX crossover is selected). There are implicit relationships that are not annotated in the configuration file; for example, crossoverProbability is associated to any crossover. There is no need to include a relationship in this case because the crossover is always used, but it could be necessary to specify it if the crossover is used as an optional parameter.

From this parameter space, the AutoNSGAII algorithm can be configured and executed in this way:

    String[] parameters =
        ("--problemName org.uma.jmetal.problem.multiobjective.zdt.ZDT1 "
            + "--randomGeneratorSeed 12 "
            + "--referenceFrontFileName "+ referenceFrontFileName + " "
                + "--maximumNumberOfEvaluations 25000 "
                + "--algorithmResult population "
                + "--populationSize 100 "
                + "--offspringPopulationSize 100 "
                + "--createInitialSolutions random "
                + "--variation crossoverAndMutationVariation "
                + "--selection tournament "
                + "--selectionTournamentSize 2 "
                + "--rankingForSelection dominanceRanking "
                + "--densityEstimatorForSelection crowdingDistance "
                + "--crossover SBX "
                + "--crossoverProbability 0.9 "
                + "--crossoverRepairStrategy bounds "
                + "--sbxDistributionIndex 20.0 "
                + "--mutation polynomial "
                + "--mutationProbabilityFactor 1.0 "
                + "--mutationRepairStrategy bounds "
                + "--polynomialMutationDistributionIndex 20.0 ")
            .split("\\s+");

    AutoNSGAII autoNSGAII = new AutoNSGAII();
    autoNSGAII.parseAndCheckParameters(parameters);

    EvolutionaryAlgorithm<DoubleSolution> nsgaII = autoNSGAII.create();

    nsgaII.run();

With this context in mind, we need to:

  • Define a way to represent the space parameter. A choice would be to parse the irace configuration file, but using for example a JSON file seems more easy to deal with.
  • Any valid configuration (that is, a list of parameters and their values) must be encoded into a list of double values to include them into a DoubleSolution in jMetal. Conversely, given a DoubleSolution'', it must be decoded into a parameter string to configure and run AutoNSGAII``.
@ajnebro ajnebro added the priority Priority issue label Jan 25, 2023
@ajnebro ajnebro added this to the First version milestone Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority Priority issue
Projects
None yet
Development

No branches or pull requests

1 participant