code: def keras_embedding_model_fn(
      optimizer_class,
      l2_norm_clip: float,
      noise_multiplier: float,
      num_microbatches: int,
      learning_rate: float,
      use_sequence_output: bool = False,
      unconnected_gradients_to_zero: bool = False,
  ):
      """Construct a simple embedding model with a classification layer."""
  
      # Every sample has 4 tokens (sequence length=4).
      x = tf.keras.layers.Input(
          shape=(4,), dtype=tf.float32, name="input"
      )
      sequence_output, pooled_output = SimpleEmbeddingModel()(x)
      if use_sequence_output:
          embedding = sequence_output
      else:
          embedding = pooled_output
      probs = tf.keras.layers.Dense(
          units=1, activation="softmax", name="classification"
      )(embedding)
      model = tf.keras.Model(inputs=x, outputs=probs, name="model")
  
      optimizer = optimizer_class(
          l2_norm_clip=l2_norm_clip,
          noise_multiplier=noise_multiplier,
          num_microbatches=num_microbatches,
          unconnected_gradients_to_zero=unconnected_gradients_to_zero,
          learning_rate=learning_rate,
      )
  
      model.compile(
          optimizer=optimizer,
          loss=tf.keras.losses.MeanSquaredError(
              # Return per-sample loss
              reduction=tf.keras.losses.Reduction.NONE
          ),
          metrics=["accuracy"],
      )
      return model
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow import estimator
  from tensorflow_privacy.privacy.optimizers import dp_optimizer_keras
  from tensorflow_privacy.privacy.optimizers import dp_optimizer_keras_vectorized
label_desc: Use image node_id 1 for calling a global function with example usage: keras_embedding_model_fn(optimizer_class, l2_norm_clip, noise_multiplier, num_microbatches, learning_rate, use_sequence_output, unconnected_gradients_to_zero) and returns: model