本文匯總了全網最為全面的26款神經網絡可視化工具 ,可以幫助大家了解神經網絡的結構組成、工作原理和性能表現 ,從而更好地進行模型調整和優化。 也可以畫出酷炫的模型圖方便模型的展示。具體如下: 1. Net2Vis:是一款自動從Keras代碼生成卷積神經網絡的抽象可視化的工具。 地址:https://github.com/viscom-ulm/Net2Vis # You can freely modify this file.
# However, you need to have a function that is named get_model and returns a Keras Model .
import json
import sys
import os
from keras .models import Sequential
from keras .layers import Conv2D , Dense , Dropout , Flatten , MaxPooling2D , AveragePooling2D
def get_model ( ):
num_classes = 25
model = Sequential ( )
model .add (Conv2D(filters=6 , kernel_size=(3 , 3 ), activation='relu' , padding='same' , input_shape=(32 ,32 ,1 )) )
model .add (AveragePooling2D() )
model .add (Conv2D(filters=16 , kernel_size=(3 , 3 ), activation='relu' ,padding='same' ) )
model .add (AveragePooling2D() )
model .add (Flatten() )
model .add (Dense(units=120 , activation='relu' ) )
model .add (Dense(units=84 , activation='relu' ) )
model .add (Dense(units=num_classes, activation = 'softmax' ) )
model .compile (loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'] )
return model
2. Visualkeras:是一個Python包,用于幫助可視化Keras(獨立或包含在TensorFlow中)神經網絡架構。它允許輕松地進行樣式設置以適應大多數需求。目前,它支持分層樣式架構生成,非常適合CNN(卷積神經網絡),以及圖形樣式架構。 地址:https://github.com/paulgavrikov/visualkeras import visualkerasmodel = ...visualkeras.layered_view(model).show() # display using your system viewervisualkeras.layered_view(model, to_file='output.png') # write to diskvisualkeras.layered_view(model, to_file='output.png').show() # write and showvisualkeras.layered_view(model)
3. draw_convnet:是一個用于繪制卷積神經網絡結構圖的Python腳本。它可以幫助您可視化卷積神經網絡的結構,包括卷積層、池化層、全連接層等。該腳本是由GitHub用戶gwding開發的,是一個開源項目,可以在GitHub上找到其源代碼和使用說明。 地址:https://github.com/gwding/draw_convnet 4. NN-SVG:有FCNN、AlexNet、LeNet三種類型。 地址:http:///NN-SVG/AlexNet.html 5. PlotNeuralNet:用于繪制報告和演示文稿中的神經網絡的LaTeX代碼。查看示例可以了解它們的制作方式。 地址:https://github.com/HarisIqbal88/PlotNeuralNet 6. TensorBoard:Graphs儀表板是用于檢查TensorFlow模型的強大工具。 地址:https://www./tensorboard?hl=zh-cn 7. Caffe: 可以使用caffe/draw.py來繪制NetParameter protobuffer。 地址:https://github.com/BVLC/caffe 地址:https://www./?s_tid=gn_logo 9. Keras.js
地址:https://transcranial./keras-js/#/
10. keras-sequential-ascii: 用于研究序列模型的架構和參數的Keras 庫 地址:https://github.com/stared/keras-sequential-ascii/ 11. Netron:可以可視化神經網絡、深度學習和機器學習模型。 Netron 支持ONNX、TensorFlow Lite、Core ML、Keras、Caffe、Darknet、MXNet、PaddlePaddle、ncnn、MNN和TensorFlow.js。還支持實驗性的PyTorch、TorchScript、TensorFlow、OpenVINO、RKNN、MediaPipe、ML.NET和scikit-learn。 地址:https://github.com/lutzroeder/Netron 12. DotNet:這是一個簡單的Python腳本,用于使用Python和Graphviz生成前饋神經網絡的圖片。 地址:https://github.com/martisak/dotnets 13.Graphviz :是 一個開源的圖可視化軟件,它可以用抽象的圖形和網絡圖來表示結構化信息。 14. Keras Visualization: keras.utils.vis_utils模塊提供了繪制Keras模型(使用graphviz)的實用函數。 地址:https:///api/utils/model_plotting_utils/ 15. Conx: Python第三方庫 conx
可以使用 net.picture()
函數來實現具有激活函數網絡的 可視化,以生成SVG、PNG或PIL。 地址:https://conx./en/latest/index.html 16. ENNUI:致力于開發拖拽式神經網絡可視化工具。 以下是一個LeNet-like 架構 的可視化示例: 17. NNet
教程:https://beckmw.
data(infert, package='datasets')
plot(neuralnet(case~parity+induced+spontaneous, infert))
18. GraphCore:主要是展示神經網絡中操作的可視化結果,但也包括了網絡結構的內容,比如每層的網絡參數等。 19. Neataptic: 提供了非常靈活的神經網絡可視化形式;神經元和突觸可以通過一行代碼進行刪除。 神經網絡運行不需要固定的結構。 允許通過神經進化(neuro-evolution)的方式為數據集調整網絡結構的形狀,并通過多線程來實現 地址:https://wagenaartje./neataptic/ 20. TensorSpace:是一個由TensorFlow.js、Three.js和Tween.js構建的神經網絡3D可視化框架。它提供Layer API以構建深度學習層、加載預訓練模型,并在瀏覽器中生成3D可視化。通過它的API接口,可以更直觀地可視化并理解任何由TensorFlow、Keras、TensorFlow.js等構建的預訓練模型。 地址:https:///index_zh.html 21. Netscope CNN Analyzer: 一個基于網絡的工具,用于可視化和分析卷積神經網絡架構(或者從技術角度講,任何有向無環圖)。目前支持Caffe的prototxt格式。 地址:http://dgschwend./netscope/quickstart.html 22. Monial:計算圖的交互式表示法,左邊是輸入,右側就是對應結構的可視化結果。 地址:https://github.com/mlajtos/moniel 23. Texample:可以通過 LaTex 來實現一個神經網絡結構的可視化。 地址:https:///tikz/examples/neural-network/ \documentclass{article}
\usepackage{tikz}
\begin{document }
\pagestyle{empty}
\def\layersep{2.5 cm}
\begin{tikzpicture}[shorten >=1 pt,->,draw=black!50 , node distance=\layersep]
\tikzstyle{every pin edge}=[<-,shorten <=1pt]
\tikzstyle {neuron }=[circle,fill =black!25,minimum size =17pt,inner sep =0pt]
\tikzstyle {input neuron }=[neuron, fill =green!50];
\tikzstyle {output neuron }=[neuron, fill =red!50];
\tikzstyle {hidden neuron }=[neuron, fill =blue!50];
\tikzstyle {annot } = [text width =4em, text centered ]
% Draw the input layer nodes
\foreach \name / \y in {1 ,... ,4 }
% This is the same as writing \foreach \name / \y in {1 /1 ,2 /2 ,3 /3 ,4 /4 }
\node [input neuron , pin =left:Input \#\y ] (I- \name ) at (0 ,- \y ) {};
% Draw the hidden layer nodes
\foreach \name / \y in {1 ,... ,5 }
\path [yshift =0.5cm]
node [hidden neuron ] (H- \name ) at (\layersep ,- \y cm ) {};
% Draw the output layer node
\node [output neuron ,pin ={[pin edge ={- > }]right:Output}, right of=H-3] (O) {};
% Connect every node in the input layer with every node in the
% hidden layer.
\foreach \source in {1,...,4}
\foreach \dest in {1,...,5}
\path (I-\source) edge (H-\dest);
% Connect every node in the hidden layer with the output layer
\foreach \source in {1,...,5}
\path (H-\source) edge (O);
% Annotate the layers
\node[annot,above of=H-1, node distance=1cm] (hl) {Hidden layer};
\node[annot,left of=hl] {Input layer};
\node[annot,right of=hl] {Output layer};
\end{tikzpicture}
% End of code
\end{document}
24. Quiver: Keras 的一款交互式 卷積神經網絡特征可視化 的一個工具。 地址:https://github.com/keplr-io/quiver 25. cnn-explainer:通過加載預訓練模型以進行CNN可視化,只需要瀏覽器就可了解CNN的預測過程! 地址:https://poloclub./cnn-explainer/
26. ML Visuals :包含神經網絡的圖形和模板,可以重復使用和自定義用于神經網絡結構的展示。 地址:https://github.com/dair-ai/ml-visuals