7個深度神經網絡可視化工具,不可錯過!
TensorBoard:TensorFlow 集成可視化工具
GitHub 官方項目:https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tensorboard
TensorBoard 涉及到的運算,通常是在訓練龐大的深度神經網絡中出現的復雜而又難以理解的運算。
為了更方便 TensorFlow 程序的理解、調試與優化,Google 發布了一套叫做 TensorBoard 的可視化工具。你可以用 TensorBoard 來展現你的 TensorFlow 圖像,繪制圖像生成的定量指標圖以及附加數據。
當 TensorBoard 設置完成后,它應該是這樣子的:
輸入下面的指令來啟動 tensorboard:
- tensorboard --logdir=/path/to/log-directory
這里的參數 logdir 指向 SummaryWriter 序列化數據的存儲路徑。如果 logdir 目錄的子目錄中包含另一次運行時的數據,那么 TensorBoard 會展示所有運行的數據。一旦 TensorBoard 開始運行,你可以通過在瀏覽器中輸入 localhost:6006 來查看 TensorBoard。進入 TensorBoard 的界面時,你會在右上角看到導航選項卡,每一個選項卡將展現一組可視化的序列化數據集 。對于你查看的每一個選項卡,如果 TensorBoard 中沒有數據與這個選項卡相關的話,則會顯示一條提示信息指示你如何序列化相關數據。
TensorFlow 圖表計算強大而又復雜,圖表可視化在理解和調試時顯得非常有幫助。
更多詳細內容參考:
- [TensorFlow 中文社區] TensorBoard: 可視化學習
- [TensorFlow 中文社區] TensorBoard: 圖表可視化
- [極客學院] TensorBoard: 可視化學習
Netscope: 支持 Caffe 的神經網絡結構在線可視化工具
官網:http://ethereon.github.io/netscope/quickstart.html
GitHub 項目:https://github.com/ethereon/netscope
“A web-based tool for visualizing neural network architectures (or technically, any directed acyclic graph). It currently supports Caffe’s prototxt format.”
Netscope 是一個支持 prototxt 格式描述的神經網絡結構的在線可視工具。它可以用來可視化 Caffe 結構里 prototxt 格式的網絡結構,使用起來也非常簡單,打開這個地址http://ethereon.github.io/netscope/#/editor,把你的描述神經網絡結構的 prototxt 文件復制到該編輯框里,按 shift+enter,就可以直接以圖形方式顯示網絡的結構了。
比如,以 mnist 的 Lenet 和 imagenet 的 AlexNet 網絡結構為例,分別把 Caffe 中 caffe/examples/mnist/lenet_train_test.prototxt和 caffe/models/bvlc_alexnet/train_val.prototxt
文件的內容復制到左側編譯框,按 shift+enter, 立即就可以得到可視化的結構圖,具體每層的參數等,如下:
Netscope 給出的幾個常見 CNN 網絡結構示例:
- AlexNet | Alex Krizhevsky, Ilya Sutskever, Geoffrey Hinton
- CaffeNet | Yangqing Jia, Evan Shelhamer, et. al.
- Fully Convolutional Network — Three Stream | Jonathan Long, Evan Shelhamer, Trevor Darrell
- GoogleNet | Christian Szegedy, et. al.
- Network in Network | Min Lin, Qiang Chen, Shuicheng Yan
- VGG 16 Layers | Karen Simonyan, Andrew Zisserman
以上網絡的 prototxt 源文件見:https://github.com/ethereon/netscope/tree/gh-pages/presets 。
使用 python/draw_net.py 繪制網絡模型
python/draw_net.py,這個文件,就是用來繪制網絡模型的,也就是將網絡模型由 prototxt 變成一張圖片。
在繪制之前,需要先安裝兩個庫
1. 安裝GraphViz
- $ sudo apt-get install GraphViz
注意,這里用的是 apt-get 來安裝,而不是 pip。
2. 安裝 pydot
- $ sudo pip install pydot
用的是 pip 來安裝,而不是 apt-get。
安裝好了,就可以調用腳本來繪制圖片了。
draw_net.py 執行的時候帶三個參數:
- 第一個參數:網絡模型的 prototxt 文件;
- 第二個參數:保存的圖片路徑及名字;
- 第二個參數:- - rankdir = x,x 有四種選項,分別是 LR, RL, TB, BT 。用來表示網絡的方向,分別是從左到右,從右到左,從上到小,從下到上。默認為 LR。
例:繪制 Lenet 模型
- $ sudo python python/draw_net.py examples/mnist/lenet_train_test.prototxt netImage/lenet.png --rankdir=BT
參考閱讀:
- Netscope: 支持 Caffe 的神經網絡結構在線可視化工具
- Caffe 學習系列 (18): 繪制網絡模型
- Caffe 學習系列——工具篇:神經網絡模型結構可視化
- 深度網絡的設計與可視化工具
Neural Network Playground
官網:http://playground.tensorflow.org
GitHub 項目:https://github.com/tensorflow/playground
Deep playground is an interactive visualization of neural networks, written in typescript using d3.js.
PlayGround 是一個圖形化用于教學目的的簡單神經網絡在線演示、實驗的平臺,非常強大地可視化了神經網絡的訓練過程。
參考閱讀:
- [知乎] 誰能詳細講解一下 TensorFlow Playground 所展示的神經網絡的概念?
- [Blog] 結合 TensorFlow PlayGround 的簡單神經網絡原理解釋
ConvnetJS
官網:http://cs.stanford.edu/people/karpathy/convnetjs/
GitHub 項目:https://github.com/karpathy/convnetjs
ConvNetJS is a Javascript library for training Deep Learning models (Neural Networks) entirely in your browser. Open a tab and you’re training. No software requirements, no compilers, no installations, no GPUs, no sweat.
Some Online Demos
- Convolutional Neural Network on MNIST digits
- Convolutional Neural Network on CIFAR-10
- Toy 2D data
- Toy 1D regression
- Training an Autoencoder on MNIST digits
- Deep Q Learning Reinforcement Learning demo
- Image Regression (“Painting”)
- Comparison of SGD/Adagrad/Adadelta on MNIST
更多內容請關注官網和 GutHub 項目 README。
WEVI
官網:wevi: word embedding visual inspector
GitHub 項目:https://github.com/ronxin/wevi
具體參考:wevi: Word Embedding Visual Inspector
CNNVis
文章來源:Towards Better Analysis of Deep Convolutional Neural Networks arxiv.org/abs/1604.07043
具體參見:能幫你更好理解分析深度卷積神經網絡,今天要解讀的是一款新型可視化工具——CNNVis,看完就能用!
摘要: 深度卷積神經網絡(CNNs)在許多模式識別任務中取得了很大的性能突破, 然而高質量深度模型的發展依賴于大量的嘗試,這是由于沒有很好的理解深度模型是怎么工作的,在本文中,提出了一個可視化分析系統 CNNVis,幫助機器學習專家更好的理解、分析、設計深度卷積神經網絡。