code: def learner(x: tf.Tensor, n_blocks: int) -> tf.Tensor:
      """Construct the Learner
      x          : input to the learner
      n_blocks   : number of blocks in a group
      """
      # First Residual Block Group of 16 filters (Stage 1)
      # Quadruple (4X) the size of filters to fit the next Residual Group
      x = residual_group(x, 16, n_blocks, strides=(1, 1), n=4)
  
      # Second Residual Block Group of 64 filters (Stage 2)
      # Double (2X) the size of filters and reduce feature maps by 75% (strides=2)
      # to fit the next Residual Group.
      x = residual_group(x, 64, n_blocks, n=2)
  
      # Third Residual Block Group of 64 filters (Stage 3)
      # Double (2X) the size of filters and reduce feature maps by 75% (strides=2)
      # to fit the next Residual Group
      x = residual_group(x, 128, n_blocks, n=2)
      return x
  
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 2 for calling a global function with example usage: learner(x, n_blocks) and returns: x