ResNet.

  Args:
    hidden_size: the size of the first hidden layer (multiplied later).
    num_output_classes: how many classes to distinguish.
    mode: whether we are training or evaluating or doing inference.

  Returns:
    The ResNet model with the given layer and output sizes.

def Resnet50(hidden_size=64, num_output_classes=1001, mode='train'):
  """ResNet.

  Args:
    hidden_size: the size of the first hidden layer (multiplied later).
    num_output_classes: how many classes to distinguish.
    mode: whether we are training or evaluating or doing inference.

  Returns:
    The ResNet model with the given layer and output sizes.
  """
  del mode
  return layers.Serial(
      layers.Conv(hidden_size, (7, 7), (2, 2), 'SAME'),
      layers.BatchNorm(), layers.Relu(),
      layers.MaxPool(pool_size=(3, 3), strides=(2, 2)),
      ConvBlock(3, [hidden_size, hidden_size, 4 * hidden_size], (1, 1)),
      IdentityBlock(3, [hidden_size, hidden_size, 4 * hidden_size]),
      IdentityBlock(3, [hidden_size, hidden_size, 4 * hidden_size]),
      ConvBlock(3, [2 * hidden_size, 2 * hidden_size, 8 * hidden_size], (2, 2)),
      IdentityBlock(3, [2 * hidden_size, 2 * hidden_size, 8 * hidden_size]),
      IdentityBlock(3, [2 * hidden_size, 2 * hidden_size, 8 * hidden_size]),
      IdentityBlock(3, [2 * hidden_size, 2 * hidden_size, 8 * hidden_size]),
      ConvBlock(3, [4 * hidden_size, 4 * hidden_size, 16*hidden_size], (2, 2)),
      IdentityBlock(3, [4 * hidden_size, 4 * hidden_size, 16 * hidden_size]),
      IdentityBlock(3, [4 * hidden_size, 4 * hidden_size, 16 * hidden_size]),
      IdentityBlock(3, [4 * hidden_size, 4 * hidden_size, 16 * hidden_size]),
      IdentityBlock(3, [4 * hidden_size, 4 * hidden_size, 16 * hidden_size]),
      IdentityBlock(3, [4 * hidden_size, 4 * hidden_size, 16 * hidden_size]),
      ConvBlock(3, [8 * hidden_size, 8 * hidden_size, 32*hidden_size], (2, 2)),
      IdentityBlock(3, [8 * hidden_size, 8 * hidden_size, 32 * hidden_size]),
      IdentityBlock(3, [8 * hidden_size, 8 * hidden_size, 32 * hidden_size]),
      layers.AvgPool(pool_size=(7, 7)), layers.Flatten(),
      layers.Dense(num_output_classes), layers.LogSoftmax())