class_docstr: Twin Delayed Deep Deterministic Policy Gradients (TD3).
  
  See http://arxiv.org/abs/1802.09477
  
  Args:
      policy (Policy): Policy.
      q_func1 (Link): First Q-function that takes state-action pairs as input
          and outputs predicted Q-values.
      q_func2 (Link): Second Q-function that takes state-action pairs as
          input and outputs predicted Q-values.
      policy_optimizer (Optimizer): Optimizer setup with the policy
      q_func1_optimizer (Optimizer): Optimizer setup with the first
          Q-function.
      q_func2_optimizer (Optimizer): Optimizer setup with the second
          Q-function.
      replay_buffer (ReplayBuffer): Replay buffer
      gamma (float): Discount factor
      explorer (Explorer): Explorer that specifies an exploration strategy.
      gpu (int): GPU device id if not None nor negative.
      replay_start_size (int): if the replay buffer's size is less than
          replay_start_size, skip update
      minibatch_size (int): Minibatch size
      update_interval (int): Model update interval in step
      phi (callable): Feature extractor applied to observations
      soft_update_tau (float): Tau of soft target update.
      logger (Logger): Logger used
      batch_states (callable): method which makes a batch of observations.
          default is `chainerrl.misc.batch_states.batch_states`
      burnin_action_func (callable or None): If not None, this callable
          object is used to select actions before the model is updated
          one or more times during training.
      policy_update_delay (int): Delay of policy updates. Policy is updated
          once in `policy_update_delay` times of Q-function updates.
      target_policy_smoothing_func (callable): Callable that takes a batch of
          actions as input and outputs a noisy version of it. It is used for
          target policy smoothing when computing target Q-values.
class_docstr_tok: ["Twin","Delayed","Deep","Deterministic","Policy","Gradients","(","TD3",")",".","See","http",":","\/\/arxiv.org\/abs\/1802.09477","Args",":","policy","(","Policy",")",":","Policy",".","q_func1","(","Link",")",":","First","Q-function","that","takes","state-action","pairs","as","input","and","outputs","predicted","Q-values",".","q_func2","(","Link",")",":","Second","Q-function","that","takes","state-action","pairs","as","input","and","outputs","predicted","Q-values",".","policy_optimizer","(","Optimizer",")",":","Optimizer","setup","with","the","policy","q_func1_optimizer","(","Optimizer",")",":","Optimizer","setup","with","the","first","Q-function",".","q_func2_optimizer","(","Optimizer",")",":","Optimizer","setup","with","the","second","Q-function",".","replay_buffer","(","ReplayBuffer",")",":","Replay","buffer","gamma","(","float",")",":","Discount","factor","explorer","(","Explorer",")",":","Explorer","that","specifies","an","exploration","strategy",".","gpu","(","int",")",":","GPU","device","id","if","not","None","nor","negative",".","replay_start_size","(","int",")",":","if","the","replay","buffer","'s","size","is","less","than","replay_start_size",",","skip","update","minibatch_size","(","int",")",":","Minibatch","size","update_interval","(","int",")",":","Model","update","interval","in","step","phi","(","callable",")",":","Feature","extractor","applied","to","observations","soft_update_tau","(","float",")",":","Tau","of","soft","target","update",".","logger","(","Logger",")",":","Logger","used","batch_states","(","callable",")",":","method","which","makes","a","batch","of","observations",".","default","is","`","chainerrl.misc.batch_states.batch_states","`","burnin_action_func","(","callable","or","None",")",":","If","not","None",",","this","callable","object","is","used","to","select","actions","before","the","model","is","updated","one","or","more","times","during","training",".","policy_update_delay","(","int",")",":","Delay","of","policy","updates",".","Policy","is","updated","once","in","`","policy_update_delay","`","times","of","Q-function","updates",".","target_policy_smoothing_func","(","callable",")",":","Callable","that","takes","a","batch","of","actions","as","input","and","outputs","a","noisy","version","of","it",".","It","is","used","for","target","policy","smoothing","when","computing","target","Q-values","."]
code: def __init__(
      self,
      policy,
      q_func1,
      q_func2,
      policy_optimizer,
      q_func1_optimizer,
      q_func2_optimizer,
      replay_buffer,
      gamma,
      explorer,
      gpu=None,
      replay_start_size=10000,
      minibatch_size=100,
      update_interval=1,
      phi=lambda x: x,
      soft_update_tau=5e-3,
      n_times_update=1,
      logger=getLogger(__name__),
      batch_states=batch_states,
      burnin_action_func=None,
      policy_update_delay=2,
      target_policy_smoothing_func=default_target_policy_smoothing_func,
  ):
      self.policy = policy
      self.q_func1 = q_func1
      self.q_func2 = q_func2
  
      if gpu is not None and gpu >= 0:
          cuda.get_device_from_id(gpu).use()
          self.policy.to_gpu(device=gpu)
          self.q_func1.to_gpu(device=gpu)
          self.q_func2.to_gpu(device=gpu)
  
      self.xp = self.policy.xp
      self.replay_buffer = replay_buffer
      self.gamma = gamma
      self.explorer = explorer
      self.gpu = gpu
      self.phi = phi
      self.soft_update_tau = soft_update_tau
      self.logger = logger
      self.policy_optimizer = policy_optimizer
      self.q_func1_optimizer = q_func1_optimizer
      self.q_func2_optimizer = q_func2_optimizer
      self.replay_updater = ReplayUpdater(
          replay_buffer=replay_buffer,
          update_func=self.update,
          batchsize=minibatch_size,
          n_times_update=1,
          replay_start_size=replay_start_size,
          update_interval=update_interval,
          episodic_update=False,
      )
      self.batch_states = batch_states
      self.burnin_action_func = burnin_action_func
      self.policy_update_delay = policy_update_delay
      self.target_policy_smoothing_func = target_policy_smoothing_func
  
      self.t = 0
      self.last_state = None
      self.last_action = None
  
      # Target model
      self.target_policy = copy.deepcopy(self.policy)
      self.target_q_func1 = copy.deepcopy(self.q_func1)
      self.target_q_func2 = copy.deepcopy(self.q_func2)
  
      # Statistics
      self.q1_record = collections.deque(maxlen=1000)
      self.q2_record = collections.deque(maxlen=1000)
      self.q_func1_loss_record = collections.deque(maxlen=100)
      self.q_func2_loss_record = collections.deque(maxlen=100)
      self.policy_loss_record = collections.deque(maxlen=100)
  
imports: import collections
  import copy
  from logging import getLogger
  import chainer
  from chainer import cuda
  import chainer.functions
  import numpy
  from chainerrl.agent import AttributeSavingMixin
  from chainerrl.agent import BatchAgent
  from chainerrl.misc.batch_states import batch_states
  from chainerrl.misc.copy_param import synchronize_parameters
  from chainerrl.replay_buffer import batch_experiences
  from chainerrl.replay_buffer import ReplayUpdater
label_desc: Use image node_id 1 to create a new TD3 object from inherited base classes: AttributeSavingMixin, BatchAgent with example: obj = TD3(policy, q_func1, q_func2, policy_optimizer, q_func1_optimizer, q_func2_optimizer, replay_buffer, gamma, explorer, gpu, replay_start_size, minibatch_size, update_interval, phi, soft_update_tau, n_times_update, logger, batch_states, burnin_action_func, policy_update_delay, target_policy_smoothing_func)