class_docstr: A TD3 Agent.
class_docstr_tok: ["A","TD3","Agent","."]
docstr: Performs a soft update of the target network parameters.
  
  For each weight w_s in the original network, and its corresponding
  weight w_t in the target network, a soft update is:
  w_t = (1- tau) x w_t + tau x ws
  
  Args:
    tau: A float scalar in [0, 1]. Default `tau=1.0` means hard update.
    period: Step interval at which the target networks are updated.
  
  Returns:
    A callable that performs a soft update of the target network parameters.
docstr_tok: ["Performs","a","soft","update","of","the","target","network","parameters",".","For","each","weight","w_s","in","the","original","network",",","and","its","corresponding","weight","w_t","in","the","target","network",",","a","soft","update","is",":","w_t","=","(","1-","tau",")","x","w_t","+","tau","x","ws","Args",":","tau",":","A","float","scalar","in","[","0",",","1","]",".","Default","`","tau=1.0","`","means","hard","update",".","period",":","Step","interval","at","which","the","target","networks","are","updated",".","Returns",":","A","callable","that","performs","a","soft","update","of","the","target","network","parameters","."]
code: def _get_target_updater(self, tau=1.0, period=1):
      """Performs a soft update of the target network parameters.
  
      For each weight w_s in the original network, and its corresponding
      weight w_t in the target network, a soft update is:
      w_t = (1- tau) x w_t + tau x ws
  
      Args:
        tau: A float scalar in [0, 1]. Default `tau=1.0` means hard update.
        period: Step interval at which the target networks are updated.
  
      Returns:
        A callable that performs a soft update of the target network parameters.
      """
      with tf.name_scope("update_targets"):
  
          def update():  # pylint: disable=missing-docstring
              critic_update_1 = common.soft_variables_update(
                  self._critic_network_1.variables,
                  self._target_critic_network_1.variables,
                  tau,
                  tau_non_trainable=1.0,
              )
  
              critic_2_update_vars = common.deduped_network_variables(
                  self._critic_network_2, self._critic_network_1
              )
              target_critic_2_update_vars = (
                  common.deduped_network_variables(
                      self._target_critic_network_2,
                      self._target_critic_network_1,
                  )
              )
  
              critic_update_2 = common.soft_variables_update(
                  critic_2_update_vars,
                  target_critic_2_update_vars,
                  tau,
                  tau_non_trainable=1.0,
              )
  
              actor_update_vars = common.deduped_network_variables(
                  self._actor_network,
                  self._critic_network_1,
                  self._critic_network_2,
              )
              target_actor_update_vars = (
                  common.deduped_network_variables(
                      self._target_actor_network,
                      self._target_critic_network_1,
                      self._target_critic_network_2,
                  )
              )
  
              actor_update = common.soft_variables_update(
                  actor_update_vars,
                  target_actor_update_vars,
                  tau,
                  tau_non_trainable=1.0,
              )
              return tf.group(
                  critic_update_1, critic_update_2, actor_update
              )
  
          return common.Periodically(update, period, "update_targets")
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  from typing import Optional, Text
  import gin
  import tensorflow
  import tensorflow_probability
  from tf_agents.agents import data_converter
  from tf_agents.agents import tf_agent
  from tf_agents.networks import network
  from tf_agents.policies import actor_policy
  from tf_agents.policies import gaussian_policy
  from tf_agents.trajectories import time_step
  from tf_agents.typing import types
  from tf_agents.utils import common
  from tf_agents.utils import eager_utils
  from tf_agents.utils import nest_utils
  from tf_agents.utils import object_identity
label_desc: Use image node_id 3 for calling the Td3Agent obj's underlying member method code with example usage: obj._get_target_updater(tau, period) and returns: common, tf