MCPcopy Create free account
hub / github.com/MorvanZhou/tutorials / mean_var_with_update

Function mean_var_with_update

tensorflowTUT/tf23_BN/tf23_BN.py:76–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

74 # apply moving average for mean and var when train on batch
75 ema = tf.train.ExponentialMovingAverage(decay=0.5)
76 def mean_var_with_update():
77 ema_apply_op = ema.apply([fc_mean, fc_var])
78 with tf.control_dependencies([ema_apply_op]):
79 return tf.identity(fc_mean), tf.identity(fc_var)
80 mean, var = mean_var_with_update()
81
82 Wx_plus_b = tf.nn.batch_normalization(Wx_plus_b, mean, var, shift, scale, epsilon)

Callers 2

add_layerFunction · 0.85
built_netFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected