code: def _build_aux_head(net, end_points, num_classes, hparams, scope):
      """Auxiliary head used for all models across all datasets."""
      activation_fn = (
          tf.nn.relu6 if hparams.use_bounded_activation else tf.nn.relu
      )
      with tf.variable_scope(scope):
          aux_logits = tf.identity(net)
          with tf.variable_scope("aux_logits"):
              aux_logits = slim.avg_pool2d(
                  aux_logits, [5, 5], stride=3, padding="VALID"
              )
              aux_logits = slim.conv2d(
                  aux_logits, 128, [1, 1], scope="proj"
              )
              aux_logits = slim.batch_norm(aux_logits, scope="aux_bn0")
              aux_logits = activation_fn(aux_logits)
              # Shape of feature map before the final layer.
              shape = aux_logits.shape
              if hparams.data_format == "NHWC":
                  shape = shape[1:3]
              else:
                  shape = shape[2:4]
              aux_logits = slim.conv2d(
                  aux_logits, 768, shape, padding="VALID"
              )
              aux_logits = slim.batch_norm(aux_logits, scope="aux_bn1")
              aux_logits = activation_fn(aux_logits)
              aux_logits = tf.contrib.layers.flatten(aux_logits)
              aux_logits = slim.fully_connected(aux_logits, num_classes)
              end_points["AuxLogits"] = aux_logits
  
file_path: adanet/research/improve_nas/trainer/nasnet.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  import tensorflow.compat.v1
label_desc: Use image node_id 8 for calling a global function with example usage: _build_aux_head(net, end_points, num_classes, hparams, scope) without return types