garage.tf.baselines.continuous_mlp_baseline module

A value function (baseline) based on a MLP model.

class ContinuousMLPBaseline(env_spec, num_seq_inputs=1, regressor_args=None, name='ContinuousMLPBaseline')[source]

Bases: garage.np.baselines.baseline.Baseline

A value function using a MLP network.

It fits the input data by performing linear regression to the outputs.

Parameters:
  • env_spec (garage.envs.env_spec.EnvSpec) – Environment specification.
  • num_seq_inputs (float) – Number of sequence per input. By default it is 1.0, which means only one single sequence.
  • regressor_args (dict) – Arguments for regressor.
  • name (str) – Name of baseline.
fit(paths)[source]

Fit regressor based on paths.

Parameters:paths (dict[numpy.ndarray]) – Sample paths.
get_param_values()[source]

Get parameter values.

Returns:A list of values of each parameter.
Return type:List[np.ndarray]
get_params_internal()[source]

Get the params, which are the trainable variables.

Returns:A list of trainable variables in the current variable scope.
Return type:List[tf.Variable]
predict(path)[source]

Predict value based on paths.

Parameters:path (dict[numpy.ndarray]) – Sample paths.
Returns:Predicted value.
Return type:numpy.ndarray
set_param_values(flattened_params)[source]

Set param values.

Parameters:flattened_params (np.ndarray) – A numpy array of parameter values.