The Geometric Toy Benchmark

Task: aroximate values of different functions
Cost: normalized distance to actual values
Number of hyperparameters to control: user specified starting at one float
State Information: remaining budget, derivate of each function in the last step, actual value of each function in the last step
Noise Level: None
Instance space: a number of different function types and their instantiations (e.g. sigmoid or linear), correlation between the functions

This is an artifical benchmark using function approximation only. Its goal is to simulate the control of multiple hyperparameters that behave differently with possible correlations between dimensions. In each step, the DAC controller tries to approximate the true value of the function in each dimension. The difference between this prediction and the true value is the cost. There are different ways to accumulate this cost built into the benchmark, by default it is the nmalized sum of costs across all dimensions.

Controlling multiple hyperparameters is a hard problem and thus this fully controllable and cheap to run benchmark aims to provide an easy starting point. Through its flexible instance space and cost functions the difficulty can be scaled up slowly before transitioning to real-world benchmarks with multiple hyperparameters.

class dacbench.benchmarks.geometric_benchmark.GeometricBenchmark(config_path=None)

Bases: AbstractBenchmark

Benchmark with default configuration & relevant functions for Geometric

create_correlation_table()

Create correlation table from Config infos

get_benchmark(dimension=None, seed=0)

[summary]

Parameters
  • dimension ([type], optional) – [description], by default None

  • seed (int, optional) – [description], by default 0

Returns

[description]

Return type

[type]

get_environment()

Return Geometric env with current configuration

Returns

Geometric environment

Return type

GeometricEnv

read_instance_set()

Read instance set from file Creates a nested List for every Intance. The List contains all functions with their respective values.

set_action_description()

Add Information about Derivative and Coordinate to Description.

set_action_values()

Adapt action values and update dependencies Number of actions can differ between functions if configured in DefaultDict Set observation space args.

Geometric environment. Original environment authors: Rasmus von Glahn

class dacbench.envs.geometric.GeometricEnv(config)

Bases: AbstractEnv

Environment for tracing different curves that are orthogonal to each other Use product approach: f(t,x,y,z) = X(t,x) * Y(t,y) * Z(t,z) Normalize Function Value on a Scale between 0 and 1

  • min and max value for normalization over all timesteps

close() bool

Close Env

Returns

Closing confirmation

Return type

bool

get_default_reward(_) float

Calculate euclidean distance between action vector and real position of Curve.

Parameters

_ (self) – ignore

Returns

Euclidean distance

Return type

float

get_default_state(_) array

Gather state information.

Parameters

_ – ignore param

Returns

numpy array with state information

Return type

np.array

get_optimal_policy(instance: Optional[List] = None, vector_action: bool = True) List[array]

Calculates the optimal policy for an instance

Parameters
  • instance (List, optional) – instance with information about function config.

  • vector_action (bool, optional) – if True return multidim actions else return onedimensional action, by default True

Returns

List with entry for each timestep that holds all optimal values in an array or as int

Return type

List[np.array]

render(dimensions: List, absolute_path: str)

Multiplot for specific dimensions of benchmark with policy actions.

Parameters

dimensions (List) – List of dimensions that get plotted

render_3d_dimensions(dimensions: List, absolute_path: str)

Plot 2 Dimensions in 3D space

Parameters

dimensions (List) – List of dimensions that get plotted. Max 2

reset() List[int]

Resets env

Returns

Environment state

Return type

numpy.array

step(action: int)

Execute environment step

Parameters

action (int) – action to execute

Returns

state, reward, done, info

Return type

np.array, float, bool, dict