68bea038ee799cfd4397621fb1f6023b657c2bdf,tensorlayer/layers.py,BatchNormLayer,__init__,#BatchNormLayer#Any#Any#Any#Any#Any#Any#Any#Any#,1721
Before Change
if not is_train: // test : mean=0, std=1
// if is_train: // train : mean=0, std=1
is_train = tf.cast(tf.ones([]), tf.bool)
else:
is_train = tf.cast(tf.zeros([]), tf.bool)
After Change
mean, var = mean_var_with_update()
self.outputs = act( tf.nn.batch_normalization(self.inputs, mean, var, beta, gamma, epsilon) )
else:
self.outputs = act( tf.nn.batch_normalization(self.inputs, moving_mean, moving_variance, beta, gamma, epsilon) )
// variables = tf.get_collection(TF_GRAPHKEYS_VARIABLES, scope=vs.name) // 8 params in TF12 if zero_debias=True
variables = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES, scope=vs.name) // 2 params beta, gamma
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: tensorlayer/tensorlayer
Commit Name: 68bea038ee799cfd4397621fb1f6023b657c2bdf
Time: 2017-01-07
Author: dhsig552@163.com
File Name: tensorlayer/layers.py
Class Name: BatchNormLayer
Method Name: __init__
Project Name: zsdonghao/text-to-image
Commit Name: d42df89c351e0c2a031ea3a9ae17fb7b844e7b79
Time: 2017-01-18
Author: dhsig552@163.com
File Name: tensorlayer/layers.py
Class Name: BatchNormLayer
Method Name: __init__
Project Name: tensorlayer/tensorlayer
Commit Name: 4d6cb5a6ea1fc8632a96591582b88d7088fafbf2
Time: 2019-05-11
Author: yingda.yin@gmail.com
File Name: tensorlayer/layers/normalization.py
Class Name: InstanceNorm
Method Name: forward