def layer_normalize(self, input_raw, epsilon=1e-8):
feature_dim = len(input_raw.get_shape()) - 1
mean_input = tf.reduce_mean(input_raw, axis=feature_dim, keep_dims=True)
std_input = tf.sqrt(tf.reduce_mean(tf.square(input_raw-mean_input), axis=feature_dim, keep_dims=True))
std_input = tf.maximum(std_input, epsilon)
output = (input_raw - mean_input) / std_input
return output
cnn_lstm_memory_normalization_model.py 文件源码
python
阅读 64
收藏 0
点赞 0
评论 0
评论列表
文章目录