Fork me on GitHub

bolero.environment.ContextualObjectiveFunction

class bolero.environment.ContextualObjectiveFunction(name='LinearContextualSphere', n_params=1, n_context_dims=1, random_state=None, **kwargs)[source]

Artificial contextual benchmark function.

Parameters:
name : string, optional (default: ‘LinearContextualSphere’)

Name of the objective function

n_params : int, optional (default: 1)

Number of dimensions

n_context_dims : int, optional (default: 1)

Number of context dimensions

random_state : RandomState or int, optional (default: None)

Random number generator or seed

kwargs : optional (default: {})

Additional keyword arguments for objective function

__init__(name='LinearContextualSphere', n_params=1, n_context_dims=1, random_state=None, **kwargs)[source]
get_args()

Get parameters for this estimator.

Returns:
params : mapping of string to any

Parameter names mapped to their values.

get_maximum_feedback(context)[source]

Returns the maximum feedback obtainable in given context.

get_num_context_dims()[source]

Returns the number of context dimensions.

is_behavior_learning_done()[source]

Check if the behavior learning is finished.

Returns:
finished : bool

Is the learning of a behavior finished?

request_context(context=None)[source]

Request that a specific context is used.

Parameters:
context : array-like, shape (n_context_dims,), optional (default=None)

The requested context that shall be used in the next rollout. Defaults to None. In that case, the environment selects the next context.

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

The actual context used in the next rollout. This is either the requested context or selected by the environment.