class_docstr: Simple Vanilla Policy Gradient.
  
  Args:
      env_spec (EnvSpec): Environment specification.
      policy (garage.tf.policies.StochasticPolicy): Policy.
      sampler (garage.sampler.Sampler): Sampler.
class_docstr_tok: ["Simple","Vanilla","Policy","Gradient",".","Args",":","env_spec","(","EnvSpec",")",":","Environment","specification",".","policy","(","garage.tf.policies.StochasticPolicy",")",":","Policy",".","sampler","(","garage.sampler.Sampler",")",":","Sampler","."]
docstr: Perform one step of policy optimization given one batch of samples.
  
  Args:
      samples (list[dict]): A list of collected samples.
  
  Returns:
      numpy.float64: Average return.
docstr_tok: ["Perform","one","step","of","policy","optimization","given","one","batch","of","samples",".","Args",":","samples","(","list","[","dict","]",")",":","A","list","of","collected","samples",".","Returns",":","numpy.float64",":","Average","return","."]
code: def _train_once(self, samples):
      """Perform one step of policy optimization given one batch of samples.
  
      Args:
          samples (list[dict]): A list of collected samples.
  
      Returns:
          numpy.float64: Average return.
  
      """
      obs = np.concatenate([path["observations"] for path in samples])
      actions = np.concatenate([path["actions"] for path in samples])
      returns = []
      for path in samples:
          returns.append(
              discount_cumsum(path["rewards"], self._discount)
          )
      returns = np.concatenate(returns)
      sess = tf.compat.v1.get_default_session()
      sess.run(
          self._train_op,
          feed_dict={
              self._observation: obs,
              self._action: actions,
              self._returns: returns,
          },
      )
      return np.mean(returns)
  
file_path: garage/src/garage/examples/tf/tutorial_vpg.py
imports: import numpy
  import tensorflow
  from garage import EpisodeBatch, log_performance, wrap_experiment
  from garage.envs import PointEnv
  from garage.experiment.deterministic import set_seed
  from garage.np import discount_cumsum
  from garage.sampler import LocalSampler
  from garage.tf.policies import GaussianMLPPolicy
  from garage.trainer import TFTrainer
label_desc: Use image node_id 4 for calling the SimpleVPG obj's underlying member method code with example usage: obj._train_once(samples) and returns: np