盤點 23 款神經(jīng)網(wǎng)絡(luò)的設(shè)計和可視化工具

極市導(dǎo)讀
?本文匯總了23個令人眼前一亮的神經(jīng)網(wǎng)絡(luò)的設(shè)計和可視化工具,并對其進行了簡要介紹。>>加入極市CV技術(shù)交流群,走在計算機視覺的最前沿
前言
draw_convnet NNSVG PlotNeuralNet TensorBoard Caffe Matlab Keras.js Keras-sequential-ascii Netron DotNet Graphviz Keras Visualization Conx ENNUI NNet GraphCore Neataptic TensorSpace Netscope CNN Analyzer Monial Texample Quiver Net2Vis
工具
1. draw_convnet
2. NNSVG



3. PlotNeuralNet


安裝
sudo apt-get install texlive-latex-extra
sudo apt-get install texlive-latex-basesudo apt-get install texlive-fonts-recommendedsudo apt-get install texlive-fonts-extrasudo apt-get install texlive-latex-extra
首先下載并安裝 MikTex,下載網(wǎng)站:https://miktex.org/download 其次,下載并安裝 windows 的 bash 運行器,推薦這兩個:
Git:https://git-scm.com/download/win Cygwin:https://www.cygwin.com/
使用例子
cd pyexamples/bash ../tikzmake.sh test_simple
先創(chuàng)建新的文件夾,并生成一個新的 python 代碼文件:
mkdir my_projectcd my_projectvim my_arch.py
然后在新的代碼文件? my_arch.py?中添加這段代碼,用于定義你的網(wǎng)絡(luò)結(jié)構(gòu),主要是不同類型網(wǎng)絡(luò)層的參數(shù),包括輸入輸出數(shù)量、卷積核數(shù)量等
import syssys.path.append('../')from pycore.tikzeng import *# defined your archarch = [to_head( '..' ),to_cor(),to_begin(),to_Conv("conv1", 512, 64, offset="(0,0,0)", to="(0,0,0)", height=64, depth=64, width=2 ),to_Pool("pool1", offset="(0,0,0)", to="(conv1-east)"),to_Conv("conv2", 128, 64, offset="(1,0,0)", to="(pool1-east)", height=32, depth=32, width=2 ),to_connection( "pool1", "conv2"),to_Pool("pool2", offset="(0,0,0)", to="(conv2-east)", height=28, depth=28, width=1),to_SoftMax("soft1", 10 ,"(3,0,0)", "(pool1-east)", caption="SOFT" ),to_connection("pool2", "soft1"),to_end()]def main():namefile = str(sys.argv[0]).split('.')[0]to_generate(arch, namefile + '.tex' )if __name__ == '__main__':main()
bash ../tikzmake.sh my_arch
4. TensorBoard

5. Caffe

6. Matlab

7. Keras.js

8. keras-sequential-ascii

安裝
pip install keras_sequential_ascii
pip install git+git://github.com/stared/keras-sequential-ascii.git
使用例子
from keras_sequential_ascii import keras2asciikeras2ascii(model)
9. Netron
簡介
ONNX:? .onnx, .pb, .pbtxt?文件Keras: .h5,.keras?文件Core ML: .mlmodelCaffe: .caffemodel, .prototxtCaffe2: predict_net.pb, predict_net.pbtxtDarknet:? .cfgMXNet: .model, -symbol.jsonncnn: .paramTensorFlow Lite: .tflite
TorchScript:? .pt, .pthPyTorch: .pt, .pthTorch:? .t7Arm NN: .armnnBarracuda: .nnBigDL? .bigdl,?.modelChainer?: .npz,?.h5CNTK?: .model,?.cntkDeeplearning4j: .zipMediaPipe: .pbtxthttp://ML.NET: .zipMNN: .mnnOpenVINO?: .xmlPaddlePaddle?: .zip,?__model__scikit-learn?: .pklTengine?: .tmfileTensorFlow.js?: model.json,?.pbTensorFlow?: .pb,?.meta,?.pbtxt,?.ckpt,?.index

安裝
下載? .dmg?文件,地址:https://github.com/lutzroeder/netron/releases/latest運行命令? brew cask install netron
下載? .AppImage?文件,下載地址:https://github.com/lutzroeder/netron/releases/latest運行命令? snap install netron
下載? .exe?文件,下載地址:https://github.com/lutzroeder/netron/releases/latest運行命令? winget install netron
pip install netron,然后使用方法有兩種:命令行,運行? netron [文件路徑].py?代碼中加入
import netron;
netron.start('文件路徑')
10. DotNet
Graphviz?生成神經(jīng)網(wǎng)絡(luò)的圖片。主要參考了文章:https://tgmstat.wordpress.com/2013/06/12/draw-neural-network-diagrams-graphviz/python dotnets.py | dot -Tpng | open -f -a /Applications/Preview.app
python dotnets.py | dot -Tpdf > test.pdf

11. Graphviz
Graphviz?是一個開源的圖可視化軟件,它可以用抽象的圖形和網(wǎng)絡(luò)圖來表示結(jié)構(gòu)化信息。
12. Keras Visualization
keras.utils.vis_utils?提供的繪制 Keras 網(wǎng)絡(luò)模型(使用的是?graphviz?)
13. Conx
conx?可以通過函數(shù)net.picture()?來實現(xiàn)對帶有激活函數(shù)網(wǎng)絡(luò)的可視化,可以輸出圖片格式包括 SVG, PNG 或者是 PIL。
14. ENNUI

15. NNet
data(infert, package="datasets")plot(neuralnet(case~parity+induced+spontaneous, infert))

16. GraphCore


17. Neataptic
神經(jīng)元和突觸可以通過一行代碼進行刪除; 沒有規(guī)定神經(jīng)網(wǎng)絡(luò)的結(jié)構(gòu)必須包含哪些內(nèi)容

18. TensorSpace

19. Netscope CNN Analyzer

20. Monial

21. Texample


22. Quiver

安裝方式
pippip install quiver_engine
pip install git+git://github.com/keplr-io/quiver.git
使用例子
model = Model(...)
quiver_engine.server.launch(model, classes=['cat','dog'], input_folder='./imgs')
from quiver_engine import server
server.launch(model)
localhost:5000
克隆這個 github 項目:
git clone https://github.com/viscom-ulm/Net2Vis
# 1.進入后端的文件夾內(nèi)cd backend# 2. 安裝依賴包pip3 install -r requirements.txt# 3. 安裝 docker容器docker build --force-rm -t tf_plus_keras .# 4. 根據(jù)你的系統(tǒng)安裝對應(yīng)的 python 的 cairo 包,比如Debian 的 python-cairosvg# 5. 開啟服務(wù)python server.py
# 1. 進入文件夾cd net2vis# 2. 安裝 JavaScript 的依賴包npm install# 3. 開啟應(yīng)用npm start
https://datascience.stackexchange.com/questions/12851/how-do-you-visualize-neural-network-architectures https://datascience.stackexchange.com/questions/2670/visualizing-deep-neural-network-training
小結(jié)
推薦閱讀
深度學(xué)習(xí)訓(xùn)練過程可視化(附github源碼)
損失函數(shù)的可視化:淺論模型的參數(shù)空間與正則
深度學(xué)習(xí)中7種最優(yōu)化算法的可視化與理解

評論
圖片
表情
