garage.tf.baselines.gaussian_mlp_baseline module

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

class GaussianMLPBaseline(env_spec, subsample_factor=1.0, num_seq_inputs=1, regressor_args=None, name='GaussianMLPBaseline')[source]

Bases: garage.np.baselines.baseline.Baseline

Gaussian MLP Baseline with Model.

It fits the input data to a gaussian distribution estimated by a MLP.

Parameters:
  • env_spec (garage.envs.env_spec.EnvSpec) – Environment specification.
  • subsample_factor (float) – The factor to subsample the data. By default it is 1.0, which means using all the data.
  • 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 (list[dict]) – 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 (list[dict]) – 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.