【问题标题】:Visualizing the features of a pretrained network in TensorFlow在 TensorFlow 中可视化预训练网络的特征
【发布时间】:2016-06-10 15:54:27
【问题描述】:
对于医疗应用,我正在使用 TensorFlow 重新训练预训练的 Inception-v3 网络。
这个网络有最后一层:
pool_3:0(2048 个特征)
使用 TF 的分类图像,我找出了其中哪些特征对每个样本最重要。所以有一个数组,其中包含前 N 个特征的索引,按权重排序。
下一步是可视化特征向量以更好地理解结果。
我该怎么做呢? TensorBoard 能做到这一点吗?
我有点不知所措。任何建议/帮助表示赞赏!
【问题讨论】:
标签:
neural-network
tensorflow
pre-trained-model
【解决方案1】:
也许只打印 N 个有趣的组件会对您有所帮助?
您可以通过以下方式获取pool_3 向量:
graph = ... # the session graph (sess.graph) containing Inception model
features = graph.get_tensor_by_name('inception_v3/pool3:0') # I don't know the exact name, find it in TensorBoard
features_values = sess.run(features)
print features_values[top_N_indices]
如果要使用 TensorBoard,只能绘图: