Title: | Benchmarking Part of the 'IOHprofiler' |
---|---|
Description: | The benchmarking module for the Iterative Optimization Heuristics Profiler ('IOHprofiler'). This module provides benchmarking in the 'IOHprofiler' format, which can be visualized using the 'IOHanalyzer' module. |
Authors: | Diederick Vermetten [cre, aut], Furong Ye [cre, aut], Hao Wang [aut], Carola Doerr [aut], Thomas Bäck [aut] |
Maintainer: | Diederick Vermetten <[email protected]> |
License: | BSD_3_clause + file LICENSE |
Version: | 0.1.4 |
Built: | 2024-12-11 07:14:35 UTC |
Source: | CRAN |
S3 generic as.character function for IOHexperimenter
## S3 method for class 'IOHexperimenter' as.character(x, ...)
## S3 method for class 'IOHexperimenter' as.character(x, ...)
x |
The IOHexperimenter to print |
... |
Arguments for underlying function |
as.character(IOHexperimenter())
as.character(IOHexperimenter())
S3 generic as.character function for IOHproblem
## S3 method for class 'IOHproblem' as.character(x, ...)
## S3 method for class 'IOHproblem' as.character(x, ...)
x |
The IOHproblem to print |
... |
Arguments for underlying function |
exp <- IOHexperimenter() p <- next_problem(exp) as.character(p)
exp <- IOHexperimenter() p <- next_problem(exp) as.character(p)
Base procedure for benchmarking a custom algorithm
benchmark_algorithm(user_alg, suite = "PBO", functions = c(1, 2), instances = c(1, 2), dimensions = 16, data.dir = NULL, algorithm.info = " ", algorithm.name = " ", params.track = NULL, repetitions = 5)
benchmark_algorithm(user_alg, suite = "PBO", functions = c(1, 2), instances = c(1, 2), dimensions = 16, data.dir = NULL, algorithm.info = " ", algorithm.name = " ", params.track = NULL, repetitions = 5)
user_alg |
Function defining the custom algorithm. Needs to accept one paramter: an IOHproblem object, which has the following properties:
And the following functions:
|
suite |
Which suite to test on |
functions |
Which function to test on |
instances |
Which instances to test on |
dimensions |
Which dimensions to test on |
data.dir |
Where the data should be stored (defaults to "./data" when not provided) |
algorithm.info |
Additional information about the algorithm you plan on running |
algorithm.name |
The name of the algorithm you plan on running |
params.track |
Which parameters to track. Should be a vector of strings, containing no spaces or commas |
repetitions |
How many independent runs of the algorithm to do for each problem instance |
benchmark_algorithm(IOH_two_rate_GA, params.track = 'Mutation_rate', data.dir = './data')
benchmark_algorithm(IOH_two_rate_GA, params.track = 'Mutation_rate', data.dir = './data')
For easier use with the IOHexperimenter
The simplest stochastic optimization algorithm for discrete problems. A randomly chosen position in the solution vector is perturbated in each iteration. Only improvements are accepted after perturbation.
IOH_random_local_search(IOHproblem, budget = NULL) random_local_search(dimension, obj_func, target_hit = function() { FALSE }, budget = NULL)
IOH_random_local_search(IOHproblem, budget = NULL) random_local_search(dimension, obj_func, target_hit = function() { FALSE }, budget = NULL)
IOHproblem |
An IOHproblem object |
budget |
integer, maximal allowable number of function evaluations |
dimension |
Dimension of search space |
obj_func |
The evaluation function |
target_hit |
Optional, function which enables early stopping if a target value is reached |
benchmark_algorithm(IOH_random_local_search, data.dir = NULL)
benchmark_algorithm(IOH_random_local_search, data.dir = NULL)
For easier use with the IOHexperimenter
Random walk in space; Maximization
Random walk in continuous space;
IOH_random_search(IOHproblem, budget = NULL) random_search_PB(dim, obj_func, target_hit = function() { FALSE }, budget = NULL) random_search(dim, obj_func, target_hit = function() { FALSE }, budget = NULL, lbound = -1, ubound = 1, maximize = T)
IOH_random_search(IOHproblem, budget = NULL) random_search_PB(dim, obj_func, target_hit = function() { FALSE }, budget = NULL) random_search(dim, obj_func, target_hit = function() { FALSE }, budget = NULL, lbound = -1, ubound = 1, maximize = T)
IOHproblem |
An IOHproblem object |
budget |
Integer, maximal allowable number of function evaluations |
dim |
Dimension of search space |
obj_func |
The evaluation function |
target_hit |
Optional, function which enables early stopping if a target value is reached |
lbound |
Lower bound of search space. Either single number or vector of size 'dim' |
ubound |
Upper bound of search space. Either single number or vector of size 'dim' |
maximize |
Whether to perform maximization or minimization. The function assumes minimization, achieved by inverting the obj_func when 'maximize' is FALSE |
benchmark_algorithm(IOH_random_search, data.dir = NULL)
benchmark_algorithm(IOH_random_search, data.dir = NULL)
For easier use with the IOHexperimenter
A genetic algorithm that controls the mutation rate (strength) using the so-called self-adaptation mechanism: the mutation rate is firstly perturbated and then the resulting value is taken to mutate Lambda solution vector. The best solution is selected along with its mutation rate.
IOH_self_adaptive_GA(IOHproblem, lambda_ = 1, budget = NULL) self_adaptive_GA(dimension, obj_func, lambda_ = 10, budget = NULL, set_parameters = NULL, target_hit = function() { FALSE })
IOH_self_adaptive_GA(IOHproblem, lambda_ = 1, budget = NULL) self_adaptive_GA(dimension, obj_func, lambda_ = 10, budget = NULL, set_parameters = NULL, target_hit = function() { FALSE })
IOHproblem |
An IOHproblem object |
lambda_ |
The size of the offspring |
budget |
How many times the objective function can be evaluated |
dimension |
Dimension of search space |
obj_func |
The evaluation function |
set_parameters |
Function to call to store the value of the registered parameters |
target_hit |
Optional, function which enables early stopping if a target value is reached |
one_comma_two_EA <- function(IOHproblem) { IOH_self_adaptive_GA(IOHproblem, lambda_=2) } benchmark_algorithm(one_comma_two_EA, params.track = "Mutation_rate", algorithm.name = "one_comma_two_EA", data.dir = NULL, algorithm.info = "Using one_comma_two_EA with specific parameter" )
one_comma_two_EA <- function(IOHproblem) { IOH_self_adaptive_GA(IOHproblem, lambda_=2) } benchmark_algorithm(one_comma_two_EA, params.track = "Mutation_rate", algorithm.name = "one_comma_two_EA", data.dir = NULL, algorithm.info = "Using one_comma_two_EA with specific parameter" )
For easier use with the IOHexperimenter
A genetic algorithm that controls the mutation rate (strength) using the so-called 2-rate self-adaptation mechanism: the mutation rate is based on a parameter r. For each generation, half offspring are generated by mutation rate 2r/dim, and half by r/2dim. r that the best offspring has been created with will be inherited by probability 3/4, the other by 1/4.
IOH_two_rate_GA(IOHproblem, lambda_ = 1, budget = NULL) two_rate_GA(dimension, obj_func, target_hit = function() { FALSE }, lambda_ = 2, budget = NULL, set_parameters = NULL)
IOH_two_rate_GA(IOHproblem, lambda_ = 1, budget = NULL) two_rate_GA(dimension, obj_func, target_hit = function() { FALSE }, lambda_ = 2, budget = NULL, set_parameters = NULL)
IOHproblem |
An IOHproblem object |
lambda_ |
The size of the offspring |
budget |
How many times the objective function can be evaluated |
dimension |
Dimension of search space |
obj_func |
The evaluation function |
target_hit |
Optional, function which enables early stopping if a target value is reached |
set_parameters |
Function to call to store the value of the registered parameters |
benchmark_algorithm(IOH_two_rate_GA)
benchmark_algorithm(IOH_two_rate_GA)
S3 class 'IOHexperimenter'
IOHexperimenter(suite = "PBO", dims = NULL, functions = NULL, instances = NULL, algorithm.info = " ", algorithm.name = " ", data.dir = NULL, param.track = NULL)
IOHexperimenter(suite = "PBO", dims = NULL, functions = NULL, instances = NULL, algorithm.info = " ", algorithm.name = " ", data.dir = NULL, param.track = NULL)
suite |
Which suite to use. Available: 'PBO', 'BBOB' |
dims |
Numerical Which dimensions to use |
functions |
Numerical Which functions from the selected suite to use |
instances |
Numerical Which problem instances to use |
algorithm.info |
Additional information about the algorithm you plan on running |
algorithm.name |
The name of the algorithm you plan on running |
data.dir |
Where the data should be stored. Defaults to NULL, meaning no data is stored. |
param.track |
Which parameters to track. Should be a vector of strings, containing no spaces or commas |
A S3 object 'DataSet'
exp <- IOHexperimenter()
exp <- IOHexperimenter()
If an 'experimenter'-argument is provided, this is the same function as 'next_problem' If not, this creates a suite consisting of a single function based on the other arguments
IOHproblem(suite = "PBO", functionnr = 1, dim = 16, instance = 1, experimenter = NULL)
IOHproblem(suite = "PBO", functionnr = 1, dim = 16, instance = 1, experimenter = NULL)
suite |
The suite to use. Either 'PBO' or 'BBOB' |
functionnr |
The number of the function to create |
dim |
The dimension of the function to create |
instance |
The instance of the function to create |
experimenter |
(optional) an IOHexperimenter object |
An IOHproblem-object has the following attributes:
"Dimension": The dimesion of the problem
"function_id: The number of the function
"instance: The number of the function-instance
suite: The suite of the function. Either 'PBO' or 'BBOB'
fopt: If known, the optimal value of the function
lbound: The lower bound of the searchspace
ubound: The upper bound of the searchspace
maximization: Boolean indicating whether the function should be maximized or minimized
params.track: The parameters which are being tracked on this function. Only available if initialized in the underlying IOHexperimenter-object (or when using the 'benchmark_algorithm'-function)
In addition to these attributes, there are three function-attributes available to use:
obj_function: The interface to evaluate the function
target_hit: Boolean indicating if the optimal has been hit (if known)
set_parameters: Interface to storing the current parameter values (if param.track is initialized), This has two arguments: the list of names of parameters to update (must match those of param.track) and a list of equal length containing their respective values.
An IOHproblem object
p <- IOHproblem()
p <- IOHproblem()
Get the next function of the currently initialized IOHexperimenter object
next_problem(experimenter)
next_problem(experimenter)
experimenter |
The IOHexperimenter object |
An IOHproblem object if available, NULL otherwise
exp <- IOHexperimenter() p <- next_problem(exp)
exp <- IOHexperimenter() p <- next_problem(exp)
S3 print function for IOHexperimenter
## S3 method for class 'IOHexperimenter' print(x, ...)
## S3 method for class 'IOHexperimenter' print(x, ...)
x |
The IOHexperimenter to print |
... |
Arguments for underlying function |
print(IOHexperimenter())
print(IOHexperimenter())
S3 print function for IOHproblem
## S3 method for class 'IOHproblem' print(x, ...)
## S3 method for class 'IOHproblem' print(x, ...)
x |
The IOHproblem to print |
... |
Arguments for underlying function |
exp <- IOHexperimenter() p <- next_problem(exp) print(p)
exp <- IOHexperimenter() p <- next_problem(exp) print(p)
Reset the IOHproblem
reset_problem(problem)
reset_problem(problem)
problem |
The IOHproblem object |
An IOHproblem object
exp <- IOHexperimenter() p <- next_problem(exp) IOH_random_search(p) p <- reset_problem(p)
exp <- IOHexperimenter() p <- next_problem(exp) IOH_random_search(p) p <- reset_problem(p)
S3 generic summary operator for IOHexperimenter
## S3 method for class 'IOHexperimenter' summary(object, ...)
## S3 method for class 'IOHexperimenter' summary(object, ...)
object |
A IOHexperimenter object |
... |
Arguments passed to other methods |
A summary of the IOHexperimenter object.
summary(IOHexperimenter())
summary(IOHexperimenter())