class_docstr: A buffer for storing trajectories experienced by a TRPO agent interacting
  with the environment, and using Generalized Advantage Estimation (GAE-lambda)
  for calculating the advantages of state-action pairs.
class_docstr_tok: ["A","buffer","for","storing","trajectories","experienced","by","a","TRPO","agent","interacting","with","the","environment",",","and","using","Generalized","Advantage","Estimation","(","GAE-lambda",")","for","calculating","the","advantages","of","state-action","pairs","."]
docstr: magic from rllab for computing discounted cumulative sums of vectors.
  
  input:
      vector x,
      [x0,
       x1,
       x2]
  
  output:
      [x0 + discount * x1 + discount^2 * x2,
       x1 + discount * x2,
       x2]
docstr_tok: ["magic","from","rllab","for","computing","discounted","cumulative","sums","of","vectors",".","input",":","vector","x",",","[","x0",",","x1",",","x2","]","output",":","[","x0","+","discount","*","x1","+","discount^2","*","x2",",","x1","+","discount","*","x2",",","x2","]"]
code: def _discount_cumsum(self, x, discount):
      """
      magic from rllab for computing discounted cumulative sums of vectors.
  
      input:
          vector x,
          [x0,
           x1,
           x2]
  
      output:
          [x0 + discount * x1 + discount^2 * x2,
           x1 + discount * x2,
           x2]
      """
      return scipy.signal.lfilter(
          [1], [1, float(-discount)], x[::-1], axis=0
      )[::-1]
  
imports: import argparse
  import copy
  import os
  import threading
  import time
  import gym
  import matplotlib.pyplot
  import numpy
  import scipy.signal
  import tensorflow
  import tensorflow_probability
  import tensorlayer
label_desc: Use image node_id 4 for calling the GAE_Buffer obj's underlying member method code with example usage: obj._discount_cumsum(x, discount) and returns: scipy