MCPcopy
hub / github.com/lllyasviel/style2paints / call

Method call

V4/s2p_v4_server/InstanceNorm.py:104–127  ·  view source on GitHub ↗
(self, inputs, training=None)

Source from the content-addressed store, hash-verified

102 self.built = True
103
104 def call(self, inputs, training=None):
105 input_shape = K.int_shape(inputs)
106 reduction_axes = list(range(0, len(input_shape)))
107
108 if (self.axis is not None):
109 del reduction_axes[self.axis]
110
111 del reduction_axes[0]
112
113 mean, var = tf.nn.moments(inputs, reduction_axes, keep_dims=True)
114 stddev = tf.sqrt(var) + self.epsilon
115 normed = (inputs - mean) / stddev
116
117 broadcast_shape = [1] * len(input_shape)
118 if self.axis is not None:
119 broadcast_shape[self.axis] = input_shape[self.axis]
120
121 if self.scale:
122 broadcast_gamma = K.reshape(self.gamma, broadcast_shape)
123 normed = normed * broadcast_gamma
124 if self.center:
125 broadcast_beta = K.reshape(self.beta, broadcast_shape)
126 normed = normed + broadcast_beta
127 return normed
128
129 def get_config(self):
130 config = {

Callers 15

cocos2d-js-min.jsFile · 0.80
nFunction · 0.80
aFunction · 0.80
rFunction · 0.80
oFunction · 0.80
cFunction · 0.80
pFunction · 0.80
_Function · 0.80
hFunction · 0.80
eFunction · 0.80
iFunction · 0.80
sFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected