SystemErrorWang / White-box-Cartoonization

Official tensorflow implementation for CVPR2020 paper “Learning to Cartoonize Using White-box Cartoon Representations”
3.96k stars 737 forks source link

作者您好,我想请教一下您在network.py中的生成器G使用resblock的作用 #86

Open zhang-ff opened 3 years ago

zhang-ff commented 3 years ago

在u_net网络中使用到了 for idx in range(num_blocks): x2= resblock(x2, outchannel=channel*4, name='block{}'.format(idx)) 这里循环调用resblock,在resblock中又做了两次卷积,我把resblock中每一次卷积后的结果进行了输出,显示为AddBias,但是具体的作用还是不太清楚。恳请各位指导。 def resblock(inputs, out_channel=32, name='resblock'):

with tf.variable_scope(name):

    x = slim.convolution2d(inputs, out_channel, [3, 3], 
                           activation_fn=None, scope='conv1')
    x= tf.nn.leaky_relu(x)
    x = slim.convolution2d(x, out_channel, [3, 3], 
                           activation_fn=None, scope='conv2')

    return x + inputs