盘点 23 款神经网络的设计和可视化工具
![](https://filescdn.proginn.com/91eeae1e829e40afd9749d5ba8ae2453/7adab1e48633ba5de43fad790831adbc.webp)
极市导读
本文汇总了23个令人眼前一亮的神经网络的设计和可视化工具,并对其进行了简要介绍。>>加入极市CV技术交流群,走在计算机视觉的最前沿
前言
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
![](https://filescdn.proginn.com/e3169dfc52f943adcaa990b0bda90d0c/1d59ada84fe4adfa9d3f095a817689d2.webp)
![](https://filescdn.proginn.com/329d9dacefaecc24b4ee637095ffba4e/8053c0cc02fe865f04c157ea09df4cc2.webp)
![](https://filescdn.proginn.com/528e877db1ca75d97a5f6377bf76d1d5/db81fadbe3f39ecb709cea3ea74d090e.webp)
3. PlotNeuralNet
![](https://filescdn.proginn.com/16bde3a6d1c06f7cddc80b4490670051/42ea3cf1727c59498a3b4ea069fd8715.webp)
![](https://filescdn.proginn.com/af741429c62aac9262065707696813e8/0b3adaa3cc3bfcf3dc5ba4be89db0c97.webp)
安装
sudo apt-get install texlive-latex-extra
sudo apt-get install texlive-latex-base
sudo apt-get install texlive-fonts-recommended
sudo apt-get install texlive-fonts-extra
sudo apt-get install texlive-latex-extra
首先下载并安装 MikTex,下载网站: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
先创建新的文件夹,并生成一个新的 python 代码文件:
mkdir my_project
cd my_project
vim my_arch.py
然后在新的代码文件 my_arch.py
中添加这段代码,用于定义你的网络结构,主要是不同类型网络层的参数,包括输入输出数量、卷积核数量等
import sys
sys.path.append('../')
from pycore.tikzeng import *
# defined your arch
arch = [
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
![](https://filescdn.proginn.com/247de621185460ead3dff28d63838f4e/8f31a2c731fe008a9054b3c1d304e78b.webp)
5. Caffe
![](https://filescdn.proginn.com/4f93079f4ee0466681644201292e5c5d/bf802cfefd56484d8169d3ba2fccf2ce.webp)
6. Matlab
![](https://filescdn.proginn.com/7a632bee2950033971f8d3f1df17b68d/18943ca6aa8ae1e1d8b704a2919bdd94.webp)
7. Keras.js
![](https://filescdn.proginn.com/e49fda121ff761e5f30aecfdd828ad7b/830f26ca06b3c66ea3959acd51bc365e.webp)
8. keras-sequential-ascii
![](https://filescdn.proginn.com/3ee0d61f9ae2d0e17607bbfb97f0cb8c/4dc88762d24acc63ea40aa09d7aa4ba6.webp)
安装
pip install keras_sequential_ascii
pip install git+git://github.com/stared/keras-sequential-ascii.git
使用例子
from keras_sequential_ascii import keras2ascii
keras2ascii(model)
9. Netron
简介
ONNX: .onnx, .pb, .pbtxt
文件Keras: .h5,.keras
文件Core ML: .mlmodel
Caffe: .caffemodel, .prototxt
Caffe2: predict_net.pb, predict_net.pbtxt
Darknet: .cfg
MXNet: .model, -symbol.json
ncnn: .param
TensorFlow Lite: .tflite
TorchScript: .pt, .pth
PyTorch: .pt, .pth
Torch: .t7
Arm NN: .armnn
Barracuda: .nn
BigDL .bigdl
,.model
Chainer : .npz
,.h5
CNTK : .model
,.cntk
Deeplearning4j: .zip
MediaPipe: .pbtxt
http://ML.NET: .zip
MNN: .mnn
OpenVINO : .xml
PaddlePaddle : .zip
,__model__
scikit-learn : .pkl
Tengine : .tmfile
TensorFlow.js : model.json
,.pb
TensorFlow : .pb
,.meta
,.pbtxt
,.ckpt
,.index
![](https://filescdn.proginn.com/3687a74ef19511a2f2075633a3236b51/5b98d21cd3bc7e41d4799f68b409d07c.webp)
安装
下载 .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
生成神经网络的图片。主要参考了文章: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
![](https://filescdn.proginn.com/ad1ed9a8cca8fe0641efbe4dd93aef48/a20c65fe5173773414b4073eaec1eb6a.webp)
11. Graphviz
Graphviz
是一个开源的图可视化软件,它可以用抽象的图形和网络图来表示结构化信息。![](https://filescdn.proginn.com/77fddb022a2c96ce0a8456bd0b687636/03893efb11982e7438340ac01c5766bc.webp)
12. Keras Visualization
keras.utils.vis_utils
提供的绘制 Keras 网络模型(使用的是 graphviz
)![](https://filescdn.proginn.com/eecc065264649bcfdfdd587f7a64eda1/84d4aac9f220d4390802c7e659bdb82e.webp)
13. Conx
conx
可以通过函数net.picture()
来实现对带有激活函数网络的可视化,可以输出图片格式包括 SVG, PNG 或者是 PIL。![](https://filescdn.proginn.com/4dcc98100bdf2f1e0a79b403cecc5281/c1f7204bce3cc5a14942dce5a8ee5f69.webp)
14. ENNUI
![](https://filescdn.proginn.com/e1a2546e763c6a3b54e182ef5644cb7f/dc81b3c7f6968db4e4f99ef0f3359699.webp)
15. NNet
data(infert, package="datasets")
plot(neuralnet(case~parity+induced+spontaneous, infert))
![](https://filescdn.proginn.com/49ba9cb392c75c2a87aac614fa5ff87c/e387230b5237875aecf7a1fd1f937458.webp)
16. GraphCore
![](https://filescdn.proginn.com/a483a073d44aa8636753e0fc9a3393f2/06fe085e658588958d31923f546195ab.webp)
![](https://filescdn.proginn.com/06a2fb39989058a746559b399e8a2d2c/03e1d1e3aea9594d706123b44ad43d9d.webp)
17. Neataptic
神经元和突触可以通过一行代码进行删除; 没有规定神经网络的结构必须包含哪些内容
![](https://filescdn.proginn.com/a6464349d77adea713e00f5e5e0da358/885eded83477e84c455264c63f7236f6.webp)
18. TensorSpace
![](https://filescdn.proginn.com/94203a2b1cfac6d28bd9589d37b07110/2044416537c6df29d7bfb3c6246574c3.webp)
19. Netscope CNN Analyzer
![](https://filescdn.proginn.com/7d359bb859c85d9855825b0c6461484a/f92156a31f01191e71134cda6d8b24a4.webp)
20. Monial
![](https://filescdn.proginn.com/b95910f6e14c796f224a6d705fb2c896/2f48ccfe2ca8e9bd2e7ad9747939a837.webp)
21. Texample
![](https://filescdn.proginn.com/52e6d2e03b6495106e0dae0b47078a22/1bb9728685ceed498c6d17d1a1117b72.webp)
![](https://filescdn.proginn.com/c1c07502f0f9df4367af1edb867231c0/077256eaefcc7455eb78cd8773d65403.webp)
22. Quiver
![](https://filescdn.proginn.com/94ffafb3a832b5063ae8a48d90dbc0a4/3127513656fbd98316e037f1c77a006e.webp)
安装方式
pip
pip 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
![](https://filescdn.proginn.com/fcb06a3bd6d9be1b098c3018bbde28d0/aad21d350c2b453894328a94d8d1f57a.webp)
克隆这个 github 项目:
git clone https://github.com/viscom-ulm/Net2Vis
# 1.进入后端的文件夹内
cd backend
# 2. 安装依赖包
pip3 install -r requirements.txt
# 3. 安装 docker容器
docker build --force-rm -t tf_plus_keras .
# 4. 根据你的系统安装对应的 python 的 cairo 包,比如Debian 的 python-cairosvg
# 5. 开启服务
python server.py
# 1. 进入文件夹
cd net2vis
# 2. 安装 JavaScript 的依赖包
npm install
# 3. 开启应用
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
小结
推荐阅读
![](https://filescdn.proginn.com/acda77aa314165739931a0742474fc0a/a4fb8ccdbbb803af495926cb72e55999.webp)
评论