Fork me on GitHub

bolero.representation.ConstantBehavior

class bolero.representation.ConstantBehavior(outputs=None)[source]

Generates constant outputs.

Parameters:
outputs : array-like, shape (n_outputs,), optional (default: zeros)

Values of constant outputs.

__init__(outputs=None)[source]
can_step()

Returns if step() can be called again.

Returns:
can_step : bool

Can we call step() again?

get_args()

Get parameters for this estimator.

Returns:
params : mapping of string to any

Parameter names mapped to their values.

get_n_params()[source]

Get number of parameters.

Returns:
n_params : int

Number of parameters that will be optimized.

get_outputs(outputs)[source]

Get outputs of the last step.

Parameters:
outputs : array-like, shape = (n_outputs,)

outputs, e.g. next action, will be updated

get_params()[source]

Get current parameters.

Returns:
params : array-like, shape = (n_params,)

Current parameters.

init(n_inputs, n_outputs)[source]

Initialize the behavior.

Parameters:
n_inputs : int

number of inputs

n_outputs : int

number of outputs

reset()[source]

Reset behavior.

Does nothing.

set_inputs(inputs)[source]

Set input for the next step.

Parameters:
inputs : array-like, shape = (n_inputs,)

inputs, e.g. current state of the system

set_meta_parameters(keys, meta_parameters)[source]

Set meta parameters (none defined for constant behavior).

set_params(params)[source]

Set new parameter values.

Parameters:
params : array-like, shape = (n_params,)

New parameters.

step()[source]

Compute output for the received input.

Use the inputs and meta-parameters to compute the outputs.