美文网首页TensorFlow操作
Batch Normalization的参数量

Batch Normalization的参数量

作者: 翻开日记 | 来源:发表于2018-10-10 14:13 被阅读0次
import tensorflow as tf
import numpy as np
x = tf.placeholder(dtype=tf.float32, shape=[32, 100, 100, 6])
y = tf.layers.batch_normalization(x)
for v in tf.global_variables():
    print(v)
print(np.sum(np.prod(v.get_shape().as_list()) for v in tf.global_variables()))
E:\IOT\ToF\venv\Scripts\python.exe D:/TensorFlow/ocr/bn_test.py
<tf.Variable 'batch_normalization/gamma:0' shape=(6,) dtype=float32_ref>
<tf.Variable 'batch_normalization/beta:0' shape=(6,) dtype=float32_ref>
<tf.Variable 'batch_normalization/moving_mean:0' shape=(6,) dtype=float32_ref>
<tf.Variable 'batch_normalization/moving_variance:0' shape=(6,) dtype=float32_ref>
24

相关文章

网友评论

    本文标题:Batch Normalization的参数量

    本文链接:https://www.haomeiwen.com/subject/ucmpaftx.html