(kernel_size, filters, norm, non_linearity,
                  mode='train')
return [
      tl.Residual(main),
      non_linearity(),
  ]
ResNet identical size block.
ResNet identical size block.
ResNet identical size block .
def IdentityBlock(kernel_size, filters, norm, non_linearity,
                  mode='train'):
  """ResNet identical size block."""
  ks = kernel_size
  filters1, filters2, filters3 = filters
  main = [
      tl.Conv(filters1, (1, 1)),
      norm(mode=mode),
      non_linearity(),
      tl.Conv(filters2, (ks, ks), padding='SAME'),
      norm(mode=mode),
      non_linearity(),
      tl.Conv(filters3, (1, 1)),
      norm(mode=mode),
  ]
  return [
      tl.Residual(main),
      non_linearity(),
  ]
def IdentityBlock ( kernel_size , filters , norm , non_linearity , mode = 'train' ) : ks = kernel_size filters1 , filters2 , filters3 = filters main = [ tl . Conv ( filters1 , ( 1 , 1 ) ) , norm ( mode = mode ) , non_linearity ( ) , tl . Conv ( filters2 , ( ks , ks ) , padding = 'SAME' ) , norm ( mode = mode ) , non_linearity ( ) , tl . Conv ( filters3 , ( 1 , 1 ) ) , norm ( mode = mode ) , ] return [ tl . Residual ( main ) , non_linearity ( ) , ]