code: def make_networks(
      action_spec: specs.BoundedArray,
      num_critic_heads: int,
      policy_layer_sizes: Sequence[int] = (50,),
      critic_layer_sizes: Sequence[int] = (50,),
      num_layers_shared: int = 1,
      distributional_critic: bool = True,
      vmin: float = -150.0,
      vmax: float = 150.0,
      num_atoms: int = 51,
  ):
      """Creates networks used by the agent."""
  
      num_dimensions = np.prod(action_spec.shape, dtype=int)
  
      policy_network = snt.Sequential(
          [
              networks.LayerNormMLP(
                  policy_layer_sizes, activate_final=True
              ),
              networks.MultivariateNormalDiagHead(
                  num_dimensions, tanh_mean=False, init_scale=0.69
              ),
          ]
      )
  
      if not distributional_critic:
          critic_layer_sizes = list(critic_layer_sizes) + [1]
  
      if not num_layers_shared:
          # No layers are shared
          critic_network_base = None
      else:
          critic_network_base = networks.LayerNormMLP(
              critic_layer_sizes[:num_layers_shared],
              activate_final=True,
          )
      critic_network_heads = [
          snt.nets.MLP(
              critic_layer_sizes,
              activation=tf.nn.elu,
              activate_final=False,
          )
          for _ in range(num_critic_heads)
      ]
      if distributional_critic:
          critic_network_heads = [
              snt.Sequential(
                  [
                      c,
                      networks.DiscreteValuedHead(
                          vmin, vmax, num_atoms
                      ),
                  ]
              )
              for c in critic_network_heads
          ]
      # The multiplexer concatenates the (maybe transformed) observations/actions.
      critic_network = snt.Sequential(
          [
              networks.CriticMultiplexer(
                  critic_network=critic_network_base,
                  action_network=networks.ClipToSpec(action_spec),
              ),
              networks.Multihead(network_heads=critic_network_heads),
          ]
      )
  
      return {
          "policy": policy_network,
          "critic": critic_network,
          "observation": tf2_utils.batch_concat,
      }
  
imports: from typing import Sequence, Tuple
  import acme
  from acme import specs
  from acme import wrappers
  from acme.agents.tf import mompo
  from acme.tf import networks
  from acme.tf import utils
  from acme.utils import lp_utils
  from dm_control import suite
  import launchpad
  import numpy
  import sonnet
  import tensorflow
  from absl.testing import absltest
  from absl.testing import parameterized
label_desc: Use image node_id 1 for calling a global function with example usage: make_networks(action_spec, num_critic_heads, policy_layer_sizes, critic_layer_sizes, num_layers_shared, distributional_critic, vmin, vmax, num_atoms) and returns: dict