(inputs, output_shape, k_h, k_w, d_h, d_w,
             stddev=0.02, name="deconv2d", use_sn=False)
Performs transposed 2D convolution of the input.
Performs transposed 2D convolution of the input.
Performs transposed 2D convolution of the input .
def deconv2d(inputs, output_shape, k_h, k_w, d_h, d_w,
             stddev=0.02, name="deconv2d", use_sn=False):
  """Performs transposed 2D convolution of the input."""
  with tf.variable_scope(name):
    w = tf.get_variable(
        "kernel", [k_h, k_w, output_shape[-1], inputs.get_shape()[-1]],
        initializer=weight_initializer(stddev=stddev))
    if use_sn:
      w = spectral_norm(w)
    deconv = tf.nn.conv2d_transpose(
        inputs, w, output_shape=output_shape, strides=[1, d_h, d_w, 1])
    bias = tf.get_variable(
        "bias", [output_shape[-1]], initializer=tf.constant_initializer(0.0))
    return tf.reshape(tf.nn.bias_add(deconv, bias), tf.shape(deconv))
def deconv2d ( inputs , output_shape , k_h , k_w , d_h , d_w , stddev = 0.02 , name = "deconv2d" , use_sn = False ) : with tf . variable_scope ( name ) : w = tf . get_variable ( "kernel" , [ k_h , k_w , output_shape [ - 1 ] , inputs . get_shape ( ) [ - 1 ] ] , initializer = weight_initializer ( stddev = stddev ) ) if use_sn : w = spectral_norm ( w ) deconv = tf . nn . conv2d_transpose ( inputs , w , output_shape = output_shape , strides = [ 1 , d_h , d_w , 1 ] ) bias = tf . get_variable ( "bias" , [ output_shape [ - 1 ] ] , initializer = tf . constant_initializer ( 0.0 ) ) return tf . reshape ( tf . nn . bias_add ( deconv , bias ) , tf . shape ( deconv ) )