如何在 TensorBoard 中显示一个张量中多个特征的分布
How to show distributions of multiple features in one tensor in TensorBoard
我有一个张量 X
,它是批量归一化层 (tf.layers.batch_normalization
) 的输出,形状为 [batch_size, 15]
。为了监控它的分布,我为 X
和 tf.summary.histogram('out_BN_0', X)
创建了一个直方图。该图是我在 > 70k 步(~ 130 个纪元)后在 Tensorboard 中得到的。它是所有 15 个特征的平均结果吗?或 X
中的任何特定功能?我如何获得一个特征(例如第 5 个)的分布?
如何为每个特征构建直方图?
import tensorflow as tf
import numpy as np
batch_size = 100
num_features = 15
X = tf.constant(np.random.uniform(size=(batch_size, num_features)))
hists = {feature_index: tf.summary.histogram(f'hist_{feature_index}', X[:, feature_index])
for feature_index in range(num_features)}
我有一个张量 X
,它是批量归一化层 (tf.layers.batch_normalization
) 的输出,形状为 [batch_size, 15]
。为了监控它的分布,我为 X
和 tf.summary.histogram('out_BN_0', X)
创建了一个直方图。该图是我在 > 70k 步(~ 130 个纪元)后在 Tensorboard 中得到的。它是所有 15 个特征的平均结果吗?或 X
中的任何特定功能?我如何获得一个特征(例如第 5 个)的分布?
如何为每个特征构建直方图?
import tensorflow as tf
import numpy as np
batch_size = 100
num_features = 15
X = tf.constant(np.random.uniform(size=(batch_size, num_features)))
hists = {feature_index: tf.summary.histogram(f'hist_{feature_index}', X[:, feature_index])
for feature_index in range(num_features)}