2016-06-10 110 views
0

對於醫療應用,我正在訓練預訓練使用網絡使用 TensorFlow在TensorFlow中可視化預訓練網絡的功能

該網絡具有一最終層:

pool_3:0(2048功能)

使用TF的classify_image,我想通了其中的這些特徵對於每個樣品最重要的。所以有一個數組,其中包含按權重排序的前N個特徵的索引。

下一步是要可視化特徵向量以更好地理解結果。

我該怎麼做呢? TensorBoard能夠做到這一點嗎? 我有點不知所措。任何建議/幫助表示讚賞!

回答

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])
  • 激活的直方圖:這不會很有用我想,但你可以嘗試它
  • 圖片:你可能可以構建一個圖像包含有趣的功能?這會有點複雜,你可以看到this previous question,涉及到this issuethis tutorial