(inputs, output_size, scope=None, stddev=0.02, bias_start=0.0,
           use_sn=False, use_bias=True)
Linear layer without the non-linear activation applied.
Linear layer without the non-linear activation applied.
Linear layer without the non - linear activation applied .
def linear(inputs, output_size, scope=None, stddev=0.02, bias_start=0.0,
           use_sn=False, use_bias=True):
  """Linear layer without the non-linear activation applied."""
  shape = inputs.get_shape().as_list()
  with tf.variable_scope(scope or "linear"):
    kernel = tf.get_variable(
        "kernel",
        [shape[1], output_size],
        initializer=weight_initializer(stddev=stddev))
    if use_sn:
      kernel = spectral_norm(kernel)
    outputs = tf.matmul(inputs, kernel)
    if use_bias:
      bias = tf.get_variable(
          "bias",
          [output_size],
          initializer=tf.constant_initializer(bias_start))
      outputs += bias
    return outputs
def linear ( inputs , output_size , scope = None , stddev = 0.02 , bias_start = 0.0 , use_sn = False , use_bias = True ) : shape = inputs . get_shape ( ) . as_list ( ) with tf . variable_scope ( scope or "linear" ) : kernel = tf . get_variable ( "kernel" , [ shape [ 1 ] , output_size ] , initializer = weight_initializer ( stddev = stddev ) ) if use_sn : kernel = spectral_norm ( kernel ) outputs = tf . matmul ( inputs , kernel ) if use_bias : bias = tf . get_variable ( "bias" , [ output_size ] , initializer = tf . constant_initializer ( bias_start ) ) outputs += bias return outputs