class_docstr: A Categorical DQN Agent based on the DQN Agent.
class_docstr_tok: ["A","Categorical","DQN","Agent","based","on","the","DQN","Agent","."]
code: def _setup_policy(
      self,
      time_step_spec,
      action_spec,
      boltzmann_temperature,
      emit_log_probability,
  ):
      policy = categorical_q_policy.CategoricalQPolicy(
          time_step_spec,
          action_spec,
          self._q_network,
          self._min_q_value,
          self._max_q_value,
          observation_and_action_constraint_splitter=(
              self._observation_and_action_constraint_splitter
          ),
      )
  
      if boltzmann_temperature is not None:
          collect_policy = boltzmann_policy.BoltzmannPolicy(
              policy, temperature=boltzmann_temperature
          )
      else:
          collect_policy = epsilon_greedy_policy.EpsilonGreedyPolicy(
              policy, epsilon=self._epsilon_greedy
          )
      policy = greedy_policy.GreedyPolicy(policy)
  
      target_policy = categorical_q_policy.CategoricalQPolicy(
          time_step_spec,
          action_spec,
          self._target_q_network,
          self._min_q_value,
          self._max_q_value,
          observation_and_action_constraint_splitter=(
              self._observation_and_action_constraint_splitter
          ),
      )
      self._target_greedy_policy = greedy_policy.GreedyPolicy(
          target_policy
      )
  
      return policy, collect_policy
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Optional, Text
  import gin
  import tensorflow
  from tf_agents.agents import tf_agent
  from tf_agents.agents.dqn import dqn_agent
  from tf_agents.networks import network
  from tf_agents.networks import utils
  from tf_agents.policies import boltzmann_policy
  from tf_agents.policies import categorical_q_policy
  from tf_agents.policies import epsilon_greedy_policy
  from tf_agents.policies import greedy_policy
  from tf_agents.trajectories import time_step
  from tf_agents.trajectories import trajectory
  from tf_agents.typing import types
  from tf_agents.utils import common
  from tf_agents.utils import nest_utils
  from tf_agents.utils import value_ops
label_desc: Use image node_id 2 for calling the CategoricalDqnAgent obj's underlying member method code with example usage: obj._setup_policy(time_step_spec, action_spec, boltzmann_temperature, emit_log_probability) and returns: policy,  collect_policy