code: def scoring_function(context_features, example_features, mode):
      """A feed-forward network to score query-document pairs."""
      del context_features
      with tf.compat.v1.name_scope("input_layer"):
          input_features = [
              tf.compat.v1.layers.flatten(example_features[name])
              for name in sorted(example_features)
              if name != "document_interaction_network_embedding"
          ]
          input_layer = tf.concat(input_features, 1)
          context_input = tf.compat.v1.layers.flatten(
              example_features["document_interaction_network_embedding"]
          )
  
      is_training = mode == tf_estimator.ModeKeys.TRAIN
      cur_layer = tf.compat.v1.layers.batch_normalization(
          input_layer,
          training=is_training,
          momentum=FLAGS.batch_norm_moment,
      )
      cur_layer = tf.keras.layers.GaussianNoise(
          FLAGS.input_noise_stddev
      )(cur_layer, training=is_training)
  
      context_layer = tf.compat.v1.layers.batch_normalization(
          context_input,
          training=is_training,
          momentum=FLAGS.batch_norm_moment,
      )
      last_dim = FLAGS.hidden_layer_dims
      for layer_width in [
          FLAGS.hidden_layer_dims,
          FLAGS.hidden_layer_dims,
      ]:
          cur_layer = tf.compat.v1.layers.dense(
              cur_layer, units=layer_width
          )
          cur_layer = tf.nn.relu(cur_layer)
          cur_layer = tf.compat.v1.layers.batch_normalization(
              cur_layer,
              training=is_training,
              momentum=FLAGS.batch_norm_moment,
          )
          cur_layer = tf.compat.v1.layers.dropout(
              inputs=cur_layer,
              rate=FLAGS.dropout_rate,
              training=is_training,
          )
  
      cur_layer = tf.compat.v1.layers.dense(cur_layer, units=last_dim)
      context_layer = tf.compat.v1.layers.dense(
          context_layer, units=last_dim
      )
      output_layer = tf.math.multiply(cur_layer, context_layer)
      output_layer = tf.math.add(output_layer, cur_layer)
      output_layer = tf.nn.relu(output_layer)
      output_layer = tf.compat.v1.layers.dropout(
          inputs=output_layer,
          rate=FLAGS.dropout_rate,
          training=is_training,
      )
  
      return tf.compat.v1.layers.dense(output_layer, units=1)
  
file_path: ranking/tensorflow_ranking/research/dasalc.py
imports: from absl import flags
  import tensorflow
  from tensorflow import estimator
  from tensorflow.python.estimator.canned import optimizers
  import tensorflow_ranking
label_desc: Use image node_id 4 for calling a global function with example usage: scoring_function(context_features, example_features, mode) and returns: tf