class_docstr: Distributional DQN Builder.
class_docstr_tok: ["Distributional","DQN","Builder","."]
docstr: Creates the policy.
  
    Expects network head which returns a tuple with the first entry
    representing q-values.
    Creates the agent policy given the collection of network components and
    environment spec. An optional boolean can be given to indicate if the
    policy will be used for evaluation.
  
  Args:
    networks: struct describing the networks needed to generate the policy.
    environment_spec: struct describing the specs of the environment.
    evaluation: when true, a version of the policy to use for evaluation
      should be returned. This is algorithm-specific so if an algorithm makes
      no distinction between behavior and evaluation policies this boolean may
      be ignored.
  
  Returns:
    Behavior policy or evaluation policy for the agent.
docstr_tok: ["Creates","the","policy",".","Expects","network","head","which","returns","a","tuple","with","the","first","entry","representing","q-values",".","Creates","the","agent","policy","given","the","collection","of","network","components","and","environment","spec",".","An","optional","boolean","can","be","given","to","indicate","if","the","policy","will","be","used","for","evaluation",".","Args",":","networks",":","struct","describing","the","networks","needed","to","generate","the","policy",".","environment_spec",":","struct","describing","the","specs","of","the","environment",".","evaluation",":","when","true",",","a","version","of","the","policy","to","use","for","evaluation","should","be","returned",".","This","is","algorithm-specific","so","if","an","algorithm","makes","no","distinction","between","behavior","and","evaluation","policies","this","boolean","may","be","ignored",".","Returns",":","Behavior","policy","or","evaluation","policy","for","the","agent","."]
code: def make_policy(
      self,
      networks: dqn_networks.DQNNetworks,
      environment_spec: specs.EnvironmentSpec,
      evaluation: bool = False,
  ) -> dqn_actor.DQNPolicy:
      """Creates the policy.
  
        Expects network head which returns a tuple with the first entry
        representing q-values.
        Creates the agent policy given the collection of network components and
        environment spec. An optional boolean can be given to indicate if the
        policy will be used for evaluation.
  
      Args:
        networks: struct describing the networks needed to generate the policy.
        environment_spec: struct describing the specs of the environment.
        evaluation: when true, a version of the policy to use for evaluation
          should be returned. This is algorithm-specific so if an algorithm makes
          no distinction between behavior and evaluation policies this boolean may
          be ignored.
  
      Returns:
        Behavior policy or evaluation policy for the agent.
      """
      del environment_spec
  
      def get_action_values(
          params: networks_lib.Params,
          observation: networks_lib.Observation,
          *args,
          **kwargs,
      ) -> networks_lib.NetworkOutput:
          return networks.policy_network.apply(
              params, observation, *args, **kwargs
          )[0]
  
      typed_network = networks_lib.TypedFeedForwardNetwork(
          init=networks.policy_network.init, apply=get_action_values
      )
      behavior_policy = dqn_actor.behavior_policy(
          dqn_networks.DQNNetworks(policy_network=typed_network)
      )
  
      return dqn_actor.alternating_epsilons_actor_core(
          behavior_policy, epsilons=self._policy_epsilons(evaluation)
      )
  
imports: from typing import Iterator, List, Optional, Sequence
  from acme import adders
  from acme import core
  from acme import specs
  from acme.adders import reverb
  from acme.agents.jax import actors
  from acme.agents.jax import builders
  from acme.agents.jax.dqn import actor
  from acme.agents.jax.dqn import config
  from acme.agents.jax.dqn import learning_lib
  from acme.agents.jax.dqn import networks
  from acme.datasets import reverb
  from acme.jax import networks
  from acme.jax import utils
  from acme.jax import variable_utils
  from acme.utils import counting
  from acme.utils import loggers
  import jax
  import optax
  import reverb
  from reverb import rate_limiters
label_desc: Use image node_id 1 for calling the DistributionalDQNBuilder obj's underlying member method code with example usage: obj.make_policy(networks, environment_spec, evaluation) and returns: dqn_actor, networks