Fork me on GitHub

bolero.controller.ContextualController

class bolero.controller.ContextualController(config={}, environment=None, behavior_search=None, **kwargs)[source]

Controller for contextual problems.

See base class “Controller” for details on usage.

The controller subsection of the configuration dictionary may contain the following additional parameters:

  • test_contexts (array-like) - the upper-level policy will be evaluated in these contexts
__init__(config={}, environment=None, behavior_search=None, **kwargs)[source]
episode_with(behavior, meta_parameter_keys=[], meta_parameters=[], record=True)

Execute a behavior in the environment.

Parameters:
behavior : Behavior

Fix behavior

meta_parameter_keys : list, optional (default: [])

Meta parameter keys

meta_parameters : list, optional (default: [])

Meta parameter values

record : bool, optional (default: True)

Record feedbacks or trajectories if activated

Returns:
feedbacks : array, shape (n_steps,)

Feedback for each step in the environment

get_args()

Get parameters for this estimator.

Returns:
params : mapping of string to any

Parameter names mapped to their values.

learn(meta_parameter_keys=(), meta_parameters=())

Learn the behavior.

Parameters:
meta_parameter_keys : list

Meta parameter keys

meta_parameters : list

Meta parameter values

Returns:
feedback_history : array, shape (n_episodes or less, dim_feedback)

Feedbacks for each episode. If is_behavior_learning_done is True before the n_episodes is reached, the length of feedback_history is shorter than n_episodes.

trajectories_

inputs to the environment (outputs of the behavior)