def WideResnet(num_blocks=3, hidden_size=64, num_output_classes=10,
               mode='train'):
  """WideResnet from https://arxiv.org/pdf/1605.07146.pdf.

  Args:
    num_blocks: int, number of blocks in a group.
    hidden_size: the size of the first hidden layer (multiplied later).
    num_output_classes: int, number of classes to distinguish.
    mode: is it training or eval.

  Returns:
    The WideResnet model with given layer and output sizes.
  """
  del mode
  return layers.Serial(
      layers.Conv(hidden_size, (3, 3), padding='SAME'),
      WideResnetGroup(num_blocks, hidden_size),
      WideResnetGroup(num_blocks, hidden_size * 2, (2, 2)),
      WideResnetGroup(num_blocks, hidden_size * 4, (2, 2)), layers.BatchNorm(),
      layers.Relu(), layers.AvgPool(pool_size=(8, 8)), layers.Flatten(),
      layers.Dense(num_output_classes), layers.LogSoftmax())
def WideResnet ( num_blocks = 3 , hidden_size = 64 , num_output_classes = 10 , mode = 'train' ) : del mode return layers . Serial ( layers . Conv ( hidden_size , ( 3 , 3 ) , padding = 'SAME' ) , WideResnetGroup ( num_blocks , hidden_size ) , WideResnetGroup ( num_blocks , hidden_size * 2 , ( 2 , 2 ) ) , WideResnetGroup ( num_blocks , hidden_size * 4 , ( 2 , 2 ) ) , layers . BatchNorm ( ) , layers . Relu ( ) , layers . AvgPool ( pool_size = ( 8 , 8 ) ) , layers . Flatten ( ) , layers . Dense ( num_output_classes ) , layers . LogSoftmax ( ) )
WideResnet from https://arxiv.org/pdf/1605.07146.pdf.

  Args:
    num_blocks: int, number of blocks in a group.
    hidden_size: the size of the first hidden layer (multiplied later).
    num_output_classes: int, number of classes to distinguish.
    mode: is it training or eval.

  Returns:
    The WideResnet model with given layer and output sizes.