(input_,
              alpha=1.0,
              normalizer_fn=ops.conditional_instance_norm,
              normalizer_params=None,
              reuse=False)
Maps content images to stylized images.

  Args:
    input_: Tensor. Batch of input images.
    alpha: Float. Width multiplier to reduce the number of filters in the model
        and slim it down. Defaults to 1.0, which results in the hyper-parameters
        used in the published paper.
    normalizer_fn: normalization layer function.  Defaults to
        ops.conditional_instance_norm.
    normalizer_params: dict of parameters to pass to the conditional instance
        normalization op.
    reuse: bool. Whether to reuse model parameters. Defaults to False.

  Returns:
    Tensor. The output of the transformer network.
Maps content images to stylized images.
Maps content images to stylized images .
def transform(input_,
              alpha=1.0,
              normalizer_fn=ops.conditional_instance_norm,
              normalizer_params=None,
              reuse=False):
  """Maps content images to stylized images.

  Args:
    input_: Tensor. Batch of input images.
    alpha: Float. Width multiplier to reduce the number of filters in the model
        and slim it down. Defaults to 1.0, which results in the hyper-parameters
        used in the published paper.
    normalizer_fn: normalization layer function.  Defaults to
        ops.conditional_instance_norm.
    normalizer_params: dict of parameters to pass to the conditional instance
        normalization op.
    reuse: bool. Whether to reuse model parameters. Defaults to False.

  Returns:
    Tensor. The output of the transformer network.
  """
  if normalizer_params is None:
    normalizer_params = {'center': True, 'scale': True}
  with tf.variable_scope('transformer', reuse=reuse):
    with slim.arg_scope(
        [slim.conv2d],
        activation_fn=tf.nn.relu,
        normalizer_fn=normalizer_fn,
        normalizer_params=normalizer_params,
        weights_initializer=tf.random_normal_initializer(0.0, 0.01),
        biases_initializer=tf.constant_initializer(0.0)):
      with tf.variable_scope('contract'):
        h = conv2d(input_, 9, 1, int(alpha * 32), 'conv1')
        h = conv2d(h, 3, 2, int(alpha * 64), 'conv2')
        h = conv2d(h, 3, 2, int(alpha * 128), 'conv3')
      with tf.variable_scope('residual'):
        h = residual_block(h, 3, 'residual1')
        h = residual_block(h, 3, 'residual2')
        h = residual_block(h, 3, 'residual3')
        h = residual_block(h, 3, 'residual4')
        h = residual_block(h, 3, 'residual5')
      with tf.variable_scope('expand'):
        h = upsampling(h, 3, 2, int(alpha * 64), 'conv1')
        h = upsampling(h, 3, 2, int(alpha * 32), 'conv2')
        return upsampling(h, 9, 1, 3, 'conv3', activation_fn=tf.nn.sigmoid)
def transform ( input_ , alpha = 1.0 , normalizer_fn = ops . conditional_instance_norm , normalizer_params = None , reuse = False ) : if normalizer_params is None : normalizer_params = { 'center' : True , 'scale' : True } with tf . variable_scope ( 'transformer' , reuse = reuse ) : with slim . arg_scope ( [ slim . conv2d ] , activation_fn = tf . nn . relu , normalizer_fn = normalizer_fn , normalizer_params = normalizer_params , weights_initializer = tf . random_normal_initializer ( 0.0 , 0.01 ) , biases_initializer = tf . constant_initializer ( 0.0 ) ) : with tf . variable_scope ( 'contract' ) : h = conv2d ( input_ , 9 , 1 , int ( alpha * 32 ) , 'conv1' ) h = conv2d ( h , 3 , 2 , int ( alpha * 64 ) , 'conv2' ) h = conv2d ( h , 3 , 2 , int ( alpha * 128 ) , 'conv3' ) with tf . variable_scope ( 'residual' ) : h = residual_block ( h , 3 , 'residual1' ) h = residual_block ( h , 3 , 'residual2' ) h = residual_block ( h , 3 , 'residual3' ) h = residual_block ( h , 3 , 'residual4' ) h = residual_block ( h , 3 , 'residual5' ) with tf . variable_scope ( 'expand' ) : h = upsampling ( h , 3 , 2 , int ( alpha * 64 ) , 'conv1' ) h = upsampling ( h , 3 , 2 , int ( alpha * 32 ) , 'conv2' ) return upsampling ( h , 9 , 1 , 3 , 'conv3' , activation_fn = tf . nn . sigmoid )