code: def classifier(x: tf.Tensor, n_classes: int = 10) -> tf.Tensor:
      """Construct a Classifier
      x         : input into the classifier
      n_classes : number of classes
      """
      # Pool the feature maps after the end of all the residual blocks
      x = BatchNormalization()(x)
      x = ReLU()(x)
      x = AveragePooling2D(pool_size=8)(x)
  
      # Flatten into 1D vector
      x = GlobalAvgPool2D()(x)
  
      # Final Dense Outputting Layer
      outputs = Dense(
          n_classes,
          activation="softmax",
          kernel_initializer="he_normal",
      )(x)
  
      return outputs
  
file_path: neural-structured-learning/research/third_party/denoised_smoothing/models/resnet20.py
imports: from typing import Union
  import tensorflow
  from tensorflow.keras import Model, Input
  from tensorflow.keras.layers import Conv2D, Dense, BatchNormalization, ReLU, Add, AveragePooling2D, GlobalAvgPool2D
  from tensorflow.keras.regularizers import l2
label_desc: Use image node_id 6 for calling a global function with example usage: classifier(x, n_classes) and returns: outputs