hzy46 / fast-neural-style-tensorflow

A tensorflow implementation for fast neural style!
932 stars 361 forks source link

hello,is there any bias_value in Conv Layer? I just see the "weight" value #37

Open LouiValley opened 7 years ago

LouiValley commented 7 years ago

def conv2d(x, input_filters, output_filters, kernel, strides, mode='REFLECT'): with tf.variable_scope('conv',reuse=False):

    shape = [kernel, kernel, input_filters, output_filters]
    weight = tf.get_variable(name = 'weight',shape=shape,dtype = tf.float32, 
                             initializer=tf.truncated_normal_initializer(stddev=0.1),trainable=True)
    x_padded = tf.pad(x, [[0, 0], [kernel / 2, kernel / 2], [kernel / 2, kernel / 2], [0, 0]], mode=mode)
    return tf.nn.conv2d(x_padded, weight, strides=[1, strides, strides, 1], padding='VALID', name='conv')