MCPcopy Create free account
hub / github.com/SystemErrorWang/White-box-Cartoonization / conv_spectral_norm

Function conv_spectral_norm

train_code/layers.py:55–62  ·  view source on GitHub ↗
(x, channel, k_size, stride=1, name='conv_snorm')

Source from the content-addressed store, hash-verified

53
54
55def conv_spectral_norm(x, channel, k_size, stride=1, name='conv_snorm'):
56 with tf.variable_scope(name):
57 w = tf.get_variable("kernel", shape=[k_size[0], k_size[1], x.get_shape()[-1], channel])
58 b = tf.get_variable("bias", [channel], initializer=tf.constant_initializer(0.0))
59
60 x = tf.nn.conv2d(input=x, filter=spectral_norm(w), strides=[1, stride, stride, 1], padding='SAME') + b
61
62 return x
63
64
65

Callers

nothing calls this directly

Calls 1

spectral_normFunction · 0.85

Tested by

no test coverage detected