【问题标题】: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,只能绘图:

    • 标量特征(标量摘要):您可以使用 tf.gather(features, [indice]) 独立绘制每个特征
    • 激活直方图:我认为这不会很有用,但您可以尝试一下
    • images:你可以构建一个包含有趣特征的图像来绘制吗?那会有点复杂,你可以看到this previous question,与this issuethis tutorial相关

    【讨论】:

      猜你喜欢
      • 2018-12-13
      • 2017-05-23
      • 2016-03-14
      • 2016-05-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-07
      • 1970-01-01
      相关资源
      最近更新 更多