Task modules¶
Benchmark Tasks definition¶
- class orion.benchmark.task.BenchmarkTask(max_trials: int, **kwargs)[source]¶
Base class describing what a task can do. A task will define the objective function and search space of it.
- Parameters
- max_trialsint
Max number of trials the experiment will run against this task.
- kwargsdict
Configurable parameters of the task, a particular task implementation can have its own parameters.
- Attributes
configuration
Return the configuration of the task.
max_trials
Return the max number of trials to run for the task.
Methods
__call__
(*args, **kwargs)All tasks will be callable by default, and method call() will be executed when a task is called directly.
call
()Define the black box function to optimize, the function will expect hyper-parameters to search and return objective values of trial with the hyper-parameters.
Return the search space for the task objective function
- __call__(*args, **kwargs)[source]¶
All tasks will be callable by default, and method call() will be executed when a task is called directly.
- abstract call() List[Dict] [source]¶
Define the black box function to optimize, the function will expect hyper-parameters to search and return objective values of trial with the hyper-parameters.
This method should be overridden by subclasses. It should receive the hyper-parameters as keyword arguments, with argument names matching the keys of the dictionary returned by
get_search_space
.
- class orion.benchmark.task.Branin(max_trials=20)[source]¶
Branin function as benchmark task
Methods
call
(x)Evaluate a 2-D branin function.
Return the search space for the task objective function
- class orion.benchmark.task.CarromTable(max_trials=20)[source]¶
CarromTable function as benchmark task
Methods
call
(x)Evaluate a 2-D CarromTable function.
Return the search space for the task objective function
- class orion.benchmark.task.EggHolder(max_trials=20, dim=2)[source]¶
EggHolder function as benchmark task
Methods
call
(x)Evaluate a n-D eggholder function.
Return the search space for the task objective function
- class orion.benchmark.task.Forrester(max_trials: int, alpha: float = 0.5, beta: float = 0.5)[source]¶
Task based on the Forrester function, as described in https://arxiv.org/abs/1905.12982
\[f(x) = ((lpha x - 2)^2) sin(eta x - 4)\]- Parameters
- max_trialsint
Maximum number of trials for this task.
- alphafloat, optional
Alpha parameter used in the above equation, by default 0.5
- betafloat, optional
Beta parameter used in the above equation, by default 0.5
Methods
call
(x)Define the black box function to optimize, the function will expect hyper-parameters to search and return objective values of trial with the hyper-parameters.
Return the search space for the task objective function
- call(x: float) List[Dict] [source]¶
Define the black box function to optimize, the function will expect hyper-parameters to search and return objective values of trial with the hyper-parameters.
This method should be overridden by subclasses. It should receive the hyper-parameters as keyword arguments, with argument names matching the keys of the dictionary returned by
get_search_space
.
- class orion.benchmark.task.RosenBrock(max_trials=20, dim=2)[source]¶
RosenBrock function as benchmark task
Methods
call
(x)Evaluate a n-D rosenbrock function.
Return the search space for the task objective function