class_docstr: Cross Entropy Method.
  
  CEM works by iteratively optimizing a gaussian distribution of policy.
  
  In each epoch, CEM does the following:
  1. Sample n_samples policies from a gaussian distribution of
     mean cur_mean and std cur_std.
  2. Collect episodes for each policy.
  3. Update cur_mean and cur_std by doing Maximum Likelihood Estimation
     over the n_best top policies in terms of return.
  
  Args:
      env_spec (EnvSpec): Environment specification.
      policy (garage.np.policies.Policy): Action policy.
      sampler (garage.sampler.Sampler): Sampler.
      n_samples (int): Number of policies sampled in one epoch.
      discount (float): Environment reward discount.
      best_frac (float): The best fraction.
      init_std (float): Initial std for policy param distribution.
      extra_std (float): Decaying std added to param distribution.
      extra_decay_time (float): Epochs that it takes to decay extra std.
class_docstr_tok: ["Cross","Entropy","Method",".","CEM","works","by","iteratively","optimizing","a","gaussian","distribution","of","policy",".","In","each","epoch",",","CEM","does","the","following",":","1",".","Sample","n_samples","policies","from","a","gaussian","distribution","of","mean","cur_mean","and","std","cur_std",".","2",".","Collect","episodes","for","each","policy",".","3",".","Update","cur_mean","and","cur_std","by","doing","Maximum","Likelihood","Estimation","over","the","n_best","top","policies","in","terms","of","return",".","Args",":","env_spec","(","EnvSpec",")",":","Environment","specification",".","policy","(","garage.np.policies.Policy",")",":","Action","policy",".","sampler","(","garage.sampler.Sampler",")",":","Sampler",".","n_samples","(","int",")",":","Number","of","policies","sampled","in","one","epoch",".","discount","(","float",")",":","Environment","reward","discount",".","best_frac","(","float",")",":","The","best","fraction",".","init_std","(","float",")",":","Initial","std","for","policy","param","distribution",".","extra_std","(","float",")",":","Decaying","std","added","to","param","distribution",".","extra_decay_time","(","float",")",":","Epochs","that","it","takes","to","decay","extra","std","."]
docstr: Return sample parameters.
  
  Args:
      epoch (int): Epoch number.
  
  Returns:
      np.ndarray: A numpy array of parameter values.
docstr_tok: ["Return","sample","parameters",".","Args",":","epoch","(","int",")",":","Epoch","number",".","Returns",":","np.ndarray",":","A","numpy","array","of","parameter","values","."]
code: def _sample_params(self, epoch):
      """Return sample parameters.
  
      Args:
          epoch (int): Epoch number.
  
      Returns:
          np.ndarray: A numpy array of parameter values.
  
      """
      extra_var_mult = max(1.0 - epoch / self._extra_decay_time, 0)
      sample_std = np.sqrt(
          np.square(self._cur_std)
          + np.square(self._extra_std) * extra_var_mult
      )
      return (
          np.random.standard_normal(self._n_params) * sample_std
          + self._cur_mean
      )
  
file_path: garage/src/garage/np/algos/cem.py
imports: import collections
  from dowel import logger, tabular
  import numpy
  from garage import log_performance
  from garage.np.algos.rl_algorithm import RLAlgorithm
label_desc: Use image node_id 2 for calling the CEM obj's underlying member method code with example usage: obj._sample_params(epoch) and returns: unknown