神经网络出图

it2022-05-05  158

神经网络论文要素

神经网络论文需要要素数据预处理示意图神经网络结构图ConvNetDrawNN-SVGPlotNeuralNet神经网络流向图 Method 3 (Windows only)

神经网络论文需要要素

针对深度学习的论文,必不可少的是需要添加以下几项:数据预处理示意图、神经网络结构图、神经网络流向图

数据预处理示意图

这次实习的项目需要用到CNN,UNet以及mask_rcnn三个网络。目前对CNN进行数据预处理及网络结构编写: 这张图片是采用CNN模型,以裁剪数据块中心像素的类别当成本数据的label

神经网络结构图

ConvNetDraw

首先,最为简单的编写方式。命令特别简单,只需要命名各网络层名字,以及给出个网络层数据大小即可。

NN-SVG

较复杂的方法生成如下结构:

PlotNeuralNet

最后一种方法最美观,但是需要一定编程。

神经网络流向图

使用代码可以将模型内部的结构画出来(这里的过程曲折,第3点参考网上大神的建议)

安装graphviz软件,下载其中的msi文件,将文件安装并配置环境。安装后可以尝试在cmd下输入dot -version查看是否安装正确。

pip install graphviz

pip install pydot,这里由于库升级的原因,必须安装pydotplus库,即pip install pydotplus,之后进入包环境,将pydotplus文件名改为pydot,并且进入parser.py文件,将其中引用改为import pydot。之后进入graphviz.py文件夹,将其中method3后面的代码替换成

Method 3 (Windows only)

if os.sys.platform == 'win32': # Try and work out the equivalent of "C:\Program Files" on this # machine (might be on drive D:, or in a different language) # if False: # os.environ.has_key('PROGRAMFILES'): # Note, we could also use the win32api to get this # information, but win32api may not be installed. path = os.path.join(os.environ['PROGRAMFILES'], 'ATT', 'GraphViz', 'bin') else: # Just in case, try the default... path = r"G:\SOFTS\Graphviz2.38\bin"#这里代表Graphviz的安装路径 progs = __find_executables(path) if progs is not None: # print "Used default install location" return progs for path in ( '/usr/bin', '/usr/local/bin', '/opt/bin', '/sw/bin', '/usr/share', '/Applications/Graphviz.app/Contents/MacOS/'): progs = __find_executables(path) if progs is not None: # print "Used path" return progs # Failed to find GraphViz # return None

这篇笔记主要借鉴了一下大神的思路,特此感谢 [1]: https://yq.aliyun.com/articles/704030 [2]: https://blog.csdn.net/fy_eng/article/details/81366723 [3]: https://github.com/HarisIqbal88/PlotNeuralNet [4]: https://cbovar.github.io/ConvNetDraw/ [5]: http://alexlenail.me/NN-SVG/


最新回复(0)