benchmark
class Benchmark(name, space, *, seed=None, prior=None, perturb_prior=None)
#
Base class for a Benchmark.
PARAMETER | DESCRIPTION |
---|---|
name |
The name of this benchmark
TYPE:
|
space |
The configuration space to use for the benchmark.
TYPE:
|
seed |
The seed to use.
TYPE:
|
prior |
The prior to use for the benchmark. If None, no prior is used. If a str, will check the local location first for a prior specific for this benchmark, otherwise assumes it to be a Path. If a Path, will load the prior from the path. If a Mapping, will be used directly.
TYPE:
|
perturb_prior |
If not None, will perturb the prior by this amount. For numericals, this is interpreted as the standard deviation of a normal distribution while for categoricals, this is interpreted as the probability of swapping the value for a random one.
TYPE:
|
Source code in src/mfpbench/benchmark.py
fidelity_range: tuple[F, F, F]
attr
#
The fidelity range of this benchmark, (start, end, step)
fidelity_name: str
attr
#
The name of the fidelity used in this benchmark
Config: type[C]
attr
#
The config type of this benchmark
Result: type[R]
attr
#
The result type of this benchmark
has_conditionals: bool
classvar
attr
#
Whether this benchmark has conditionals in it or not
space: ConfigurationSpace
attr
#
The configuration space used in this benchmark
start: F
attr
#
The start of the fidelity range
end: F
attr
#
The end of the fidelity range
step: F
attr
#
The step of the fidelity range
def iter_fidelities(frm=None, to=None, step=None)
#
Iterate through the advertised fidelity space of the benchmark.
PARAMETER | DESCRIPTION |
---|---|
frm |
Start of the curve, defaults to the minimum fidelity
TYPE:
|
to |
End of the curve, defaults to the maximum fidelity
TYPE:
|
step |
Step size, defaults to benchmark standard (1 for epoch)
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Iterator[F]
|
An iterator over the fidelities |
Source code in src/mfpbench/benchmark.py
def load()
#
def query(config, at=None, *, argmax=None, argmin=None)
#
Submit a query and get a result.
PARAMETER | DESCRIPTION |
---|---|
config |
The query to use |
at |
The fidelity at which to query, defaults to None which means maximum
TYPE:
|
argmax |
Whether to return the argmax up to the point
TYPE:
|
argmin |
Whether to return the argmin up to the point
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
R
|
The result of the query |
Source code in src/mfpbench/benchmark.py
def trajectory(config, *, frm=None, to=None, step=None)
#
Get the full trajectory of a configuration.
PARAMETER | DESCRIPTION |
---|---|
config |
The config to query |
frm |
Start of the curve, should default to the start
TYPE:
|
to |
End of the curve, should default to the total
TYPE:
|
step |
Step size, defaults to
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
list[R]
|
A list of the results for this config |
Source code in src/mfpbench/benchmark.py
def sample(n=None, *, seed=None)
#
Sample a random possible config.
PARAMETER | DESCRIPTION |
---|---|
n |
How many samples to take, None means jsut a single one, not in a list
TYPE:
|
seed |
The seed to use for sampling Seeding This is different than any seed passed to the construction of the benchmark.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
C | list[C]
|
Get back a possible Config to use |