Fork me on GitHub

bolero.behavior_search.ContextualBlackBoxSearch

class bolero.behavior_search.ContextualBlackBoxSearch(behavior, optimizer, metaparameter_keys=[], metaparameter_values=[])[source]

Combine a contextual black box optimizer with a black box behavior.

Black box in this context means that only a fixed number of parameters will optimized with respect to a scalar reward function.

Parameters:
behavior : dict or Behavior subclass

A black-box behavior that is given directly or fully specified by a configuration dictionary.

optimizer : dict or ContextualOptimizer subclass

A black-box optimizer that is given directly or fully specified by a configuration dictionary.

metaparameter_keys : list, optional (default: [])

Names of metaparameters for the behavior that will be set during initialization.

metaparameter_values : list, optional (default: [])

Values of metaparameters for the behavior that will be set during initialization.

__init__(behavior, optimizer, metaparameter_keys=[], metaparameter_values=[])[source]
get_args()

Get parameters for this estimator.

Returns:
params : mapping of string to any

Parameter names mapped to their values.

get_best_behavior_template()[source]

Return current best estimate of contextual policy.

get_desired_context()[source]

Chooses desired context for next evaluation.

Returns:
context : ndarray-like, default=None

The context in which the next rollout shall be performed. If None, the environment may select the next context without any preferences.

set_context(context)[source]

Set context of next evaluation.

Note that the set context need not necessarily be the same that was requested by get_desired_context().

Parameters:
context : array-like, shape (n_context_dims,)

The context in which the next rollout will be performed