MCPcopy Create free account
hub / github.com/OUCMachineLearning/OUCML / resblock

Function resblock

GAN/Self_attention_GAN_tensorflow/ops.py:100–111  ·  view source on GitHub ↗
(x_init, channels, use_bias=True, is_training=True, sn=False, scope='resblock')

Source from the content-addressed store, hash-verified

98##################################################################################
99
100def resblock(x_init, channels, use_bias=True, is_training=True, sn=False, scope='resblock'):
101 with tf.variable_scope(scope):
102 with tf.variable_scope('res1'):
103 x = conv(x_init, channels, kernel=3, stride=1, pad=1, pad_type='reflect', use_bias=use_bias, sn=sn)
104 x = batch_norm(x, is_training)
105 x = relu(x)
106
107 with tf.variable_scope('res2'):
108 x = conv(x, channels, kernel=3, stride=1, pad=1, pad_type='reflect', use_bias=use_bias, sn=sn)
109 x = batch_norm(x, is_training)
110
111 return x + x_init
112
113##################################################################################
114# Sampling

Callers

nothing calls this directly

Calls 3

batch_normFunction · 0.85
reluFunction · 0.85
convFunction · 0.70

Tested by

no test coverage detected