class_docstr: DDPG class
class_docstr_tok: ["DDPG","class"]
docstr: Update parameters
  :return: None
docstr_tok: ["Update","parameters",":","return",":","None"]
code: def learn(self):
      """
      Update parameters
      :return: None
      """
      self.var *= 0.9995
      indices = np.random.choice(MEMORY_CAPACITY, size=BATCH_SIZE)
      datas = self.memory[indices, :]
      states = datas[:, : self.state_dim]
      actions = datas[
          :, self.state_dim : self.state_dim + self.action_dim
      ]
      rewards = datas[:, -self.state_dim - 1 : -self.state_dim]
      states_ = datas[:, -self.state_dim :]
  
      with tf.GradientTape() as tape:
          actions_ = self.actor_target(states_)
          q_ = self.critic_target([states_, actions_])
          y = rewards + GAMMA * q_
          q = self.critic([states, actions])
          td_error = tf.losses.mean_squared_error(y, q)
      critic_grads = tape.gradient(
          td_error, self.critic.trainable_weights
      )
      self.critic_opt.apply_gradients(
          zip(critic_grads, self.critic.trainable_weights)
      )
  
      with tf.GradientTape() as tape:
          a = self.actor(states)
          q = self.critic([states, a])
          actor_loss = -tf.reduce_mean(q)  # maximize the q
      actor_grads = tape.gradient(
          actor_loss, self.actor.trainable_weights
      )
      self.actor_opt.apply_gradients(
          zip(actor_grads, self.actor.trainable_weights)
      )
      self.ema_update()
  
file_path: TensorLayer/examples/reinforcement_learning/tutorial_DDPG.py
imports: import argparse
  import os
  import time
  import gym
  import matplotlib.pyplot
  import numpy
  import tensorflow
  import tensorlayer
label_desc: Use image node_id 4 for calling the DDPG obj's underlying member method code with example usage: obj.learn() without return types