class_docstr: Head layer for network outputs.
class_docstr_tok: ["Head","layer","for","network","outputs","."]
code: def __init__(self, global_params, name=None):
      super().__init__(name=name)
  
      self.endpoints = {}
      self._global_params = global_params
  
      self._conv_head = tf.keras.layers.Conv2D(
          filters=round_filters(
              1280, global_params, global_params.fix_head_stem
          ),
          kernel_size=[1, 1],
          strides=[1, 1],
          kernel_initializer=conv_kernel_initializer,
          padding="same",
          data_format=global_params.data_format,
          use_bias=False,
          name="conv2d",
      )
      self._bn = global_params.batch_norm(
          axis=(
              1 if global_params.data_format == "channels_first" else -1
          ),
          momentum=global_params.batch_norm_momentum,
          epsilon=global_params.batch_norm_epsilon,
      )
      self._relu_fn = global_params.relu_fn or tf.nn.swish
  
      self._avg_pooling = tf.keras.layers.GlobalAveragePooling2D(
          data_format=global_params.data_format
      )
      if global_params.num_classes:
          self._fc = tf.keras.layers.Dense(
              global_params.num_classes,
              kernel_initializer=dense_kernel_initializer,
          )
      else:
          self._fc = None
  
      if global_params.dropout_rate > 0:
          self._dropout = tf.keras.layers.Dropout(
              global_params.dropout_rate
          )
      else:
          self._dropout = None
  
      self.h_axis, self.w_axis = (
          [2, 3]
          if global_params.data_format == "channels_first"
          else [1, 2]
      )
  
imports: import collections
  import itertools
  import math
  from absl import logging
  import numpy
  import six
  from six.moves import xrange
  import tensorflow
  import utils
label_desc: Use image node_id 1 to create a new Head object from inherited base classes: tf.keras.layers with example: obj = Head(global_params, name)