code: def make_dqn_atari_network(
      environment_spec: specs.EnvironmentSpec,
  ) -> dqn.DQNNetworks:
      """Creates networks for training DQN on Atari."""
  
      def network(inputs):
          model = hk.Sequential(
              [
                  networks_lib.AtariTorso(),
                  hk.nets.MLP(
                      [512, environment_spec.actions.num_values]
                  ),
              ]
          )
          return model(inputs)
  
      network_hk = hk.without_apply_rng(hk.transform(network))
      obs = utils.add_batch_dim(
          utils.zeros_like(environment_spec.observations)
      )
      network = networks_lib.FeedForwardNetwork(
          init=lambda rng: network_hk.init(rng, obs),
          apply=network_hk.apply,
      )
      typed_network = networks_lib.non_stochastic_network_to_typed(
          network
      )
      return dqn.DQNNetworks(policy_network=typed_network)
  
file_path: acme/examples/baselines/rl_discrete/helpers.py
imports: import functools
  import os
  from typing import Tuple
  from absl import flags
  from acme import specs
  from acme import wrappers
  from acme.agents.jax import dqn
  from acme.jax import networks
  from acme.jax import utils
  import atari_py
  import dm_env
  import gym
  import haiku
  import jax.numpy
label_desc: Use image node_id 2 for calling a global function with example usage: make_dqn_atari_network(environment_spec) and returns: dqn, model