zhengziqiang / ForkGAN

ForkGAN: Seeing into the rainy night. ECCV 2020 (oral). A task-agnostic image translation framework that can boost multiple vision tasks in adverse weather conditions, including localization, semantic segmentation and object detection.
121 stars 16 forks source link

no fully-connected layer #6

Open nachifur opened 3 years ago

nachifur commented 3 years ago

Nice work! Thank you for sharing your code. I am confused about the fully connected layer image I can't find the fully connected layer function applied in the network code. This function (https://github.com/zhengziqiang/ForkGAN/blob/master/ops.py) does not seem to be used elsewhere.

def linear(input_, output_size, scope=None, stddev=0.02, bias_start=0.0, with_w=False):
    with tf.variable_scope(scope or "Linear"):
        matrix = tf.get_variable("Matrix", [input_.get_shape()[-1], output_size], tf.float32,
                                 tf.random_normal_initializer(stddev=stddev))
        bias = tf.get_variable("bias", [output_size],
                               initializer=tf.constant_initializer(bias_start))
        if with_w:
            return tf.matmul(input_, matrix) + bias, matrix, bias
        else:
            return tf.matmul(input_, matrix) + bias