code: def make_networks(
      action_spec: specs.Array,
      num_critic_heads: int,
      policy_layer_sizes: Sequence[int] = (300, 200),
      critic_layer_sizes: Sequence[int] = (400, 300),
      num_layers_shared: int = 1,
      distributional_critic: bool = True,
      vmin: float = -150.0,
      vmax: float = 150.0,
      num_atoms: int = 51,
  ) -> Dict[str, snt.Module]:
      """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
              ),
              networks.Multihead(network_heads=critic_network_heads),
          ]
      )
      return {
          "policy": policy_network,
          "critic": critic_network,
      }
  
file_path: acme/acme/agents/tf/mompo/agent_test.py
imports: from typing import Dict, Sequence, Tuple
  import acme
  from acme import specs
  from acme.agents.tf import mompo
  from acme.testing import fakes
  from acme.tf import networks
  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