code: def create_mapping_network(
      latent_code_dimension: int = 128,
      output_dimension: Optional[int] = None,
      normalize_latent_code: bool = True,
      relu_leakiness: float = 0.2,
      num_layers: int = 8,
      learning_rate_multiplier: float = 0.01,
      name: str = "mapping",
  ) -> tf.keras.Model:
      """Creates the mapping network using the functional API.
  
      The function creates the mapping network as defined in "A Style-Based
      Generator Architecture for Generative Adversarial Networks"
      https://arxiv.org/abs/1812.04948 using the Keras functional API.
  
      Args:
        latent_code_dimension: The number of dimensions in the latent code.
        output_dimension: The dimension of the output. By default it is latent code
          dimension.
        normalize_latent_code: If true the latent code is normalized to unit length
          before feeding it to the network.
        relu_leakiness: The leakiness of the relu.
        num_layers: The number of dense layers that will be used.
        learning_rate_multiplier: The learning rate multiplier that is used in the
          scaled dense layer. This assumes that the network is trained using ADAM or
          a similar optimizer that normalizes the length of the gradient.
        name: The name of the Keras model.
  
      Returns:
        The mapping network.
      """
      if output_dimension is None:
          output_dimension = latent_code_dimension
  
      input_tensor = tf.keras.Input(shape=(latent_code_dimension,))
      if normalize_latent_code:
          maybe_normalized_input_tensor = (
              keras_layers.PixelNormalization(axis=1)(input_tensor)
          )
      else:
          maybe_normalized_input_tensor = input_tensor
  
      tensor = maybe_normalized_input_tensor
      for i in range(num_layers):
          with tf.name_scope(name="mapping_layer_%d" % i):
              # The kernel_multiplier implements the reduced learning rate of the
              # mapping network.
              tensor = keras_layers.FanInScaledDense(
                  units=output_dimension,
                  kernel_multiplier=learning_rate_multiplier,
                  bias_multiplier=learning_rate_multiplier,
                  kernel_initializer=tf.keras.initializers.TruncatedNormal(
                      mean=0.0, stddev=1.0 / learning_rate_multiplier
                  ),
              )(tensor)
              tensor = tf.keras.layers.LeakyReLU(alpha=relu_leakiness)(
                  tensor
              )
      return tf.keras.Model(
          inputs=input_tensor, outputs=tensor, name=name
      )
  
file_path: graphics/tensorflow_graphics/projects/gan/architectures_style_gan.py
imports: from typing import Callable, Optional, Sequence, Tuple, Union
  import tensorflow
  import tensorflow_addons.layers.normalizations
  from tensorflow_graphics.projects.gan import architectures_progressive_gan
  from tensorflow_graphics.projects.gan import keras_layers
label_desc: Use image node_id 2 for calling a global function with example usage: create_mapping_network(latent_code_dimension, output_dimension, normalize_latent_code, relu_leakiness, num_layers, learning_rate_multiplier, name) and returns: tf