前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >怎么画高大上的神经网络结构?试试这个!

怎么画高大上的神经网络结构?试试这个!

作者头像
IT阅读排行榜
发布2019-03-12 10:43:10
3.2K1
发布2019-03-12 10:43:10
举报
文章被收录于专栏:华章科技华章科技

导读:现在这年头,做深度学习的,如果不在自己的文章里画一个神经网络结构图,都不好意思出门跟人说话。今天小编给大家介绍一个工具,让你简单又快速的搞定神经网络结构图:PlotNeuralNet。

来源:专知(ID:Quan_Zhuanzhi)

01 工具简介

PlotNeuralNet工具,具如其名,plot neural net用的,首先我们看看效果:

▲FCN-8

▲VGG-16

▲Holistically-Nested Edge Detection

02 安装使用

PlotNeuralNet的使用方法非常简单,首先将这个项目克隆下来:

代码语言:javascript
复制
git clone https://github.com/HarisIqbal88/PlotNeuralNet

然后,你可以自己写一个python脚本,想要用什么结构,就从PlotNerualNet里找对应的模块,然后,把它们拼起来就行, 好比UNet:

你只需要按部就班的堆:

代码语言:javascript
复制
import sys
sys.path.append('../')
from core.tikzeng 
import *from core.blocks  import *

arch = [ 
    to_head('..'), 
    to_cor(),
    to_begin(),    
    #input
    to_input( '../examples/fcn8s/cats.jpg' ),    

    #block-001
    to_ConvConvRelu( name='ccr_b1', s_filer=500, n_filer=(64,64), offset="(0,0,0)", to="(0,0,0)", width=(2,2), height=40, depth=40  ),
    to_Pool(name="pool_b1", offset="(0,0,0)", to="(ccr_b1-east)", width=1, height=32, depth=32, opacity=0.5),    

    *block_2ConvPool( name='b2', botton='pool_b1', top='pool_b2', s_filer=256, n_filer=128, offset="(1,0,0)", size=(32,32,3.5), opacity=0.5 ),    
    *block_2ConvPool( name='b3', botton='pool_b2', top='pool_b3', s_filer=128, n_filer=256, offset="(1,0,0)", size=(25,25,4.5), opacity=0.5 ),    
    *block_2ConvPool( name='b4', botton='pool_b3', top='pool_b4', s_filer=64,  n_filer=512, offset="(1,0,0)", size=(16,16,5.5), opacity=0.5 ),    

    #Bottleneck
    #block-005
    to_ConvConvRelu( name='ccr_b5', s_filer=32, n_filer=(1024,1024), offset="(2,0,0)", to="(pool_b4-east)", width=(8,8), height=8, depth=8, caption="Bottleneck"  ),
    to_connection( "pool_b4", "ccr_b5"),    

    #Decoder
    *block_Unconv( name="b6", botton="ccr_b5", top='end_b6', s_filer=64,  n_filer=512, offset="(2.1,0,0)", size=(16,16,5.0), opacity=0.5 ),
    to_skip( of='ccr_b4', to='ccr_res_b6', pos=1.25),    
    *block_Unconv( name="b7", botton="end_b6", top='end_b7', s_filer=128, n_filer=256, offset="(2.1,0,0)", size=(25,25,4.5), opacity=0.5 ),
    to_skip( of='ccr_b3', to='ccr_res_b7', pos=1.25),    
    *block_Unconv( name="b8", botton="end_b7", top='end_b8', s_filer=256, n_filer=128, offset="(2.1,0,0)", size=(32,32,3.5), opacity=0.5 ),
    to_skip( of='ccr_b2', to='ccr_res_b8', pos=1.25),    

    *block_Unconv( name="b9", botton="end_b8", top='end_b9', s_filer=512, n_filer=64,  offset="(2.1,0,0)", size=(40,40,2.5), opacity=0.5 ),
    to_skip( of='ccr_b1', to='ccr_res_b9', pos=1.25),

    to_ConvSoftMax( name="soft1", s_filer=512, offset="(0.75,0,0)", to="(end_b9-east)", width=1, height=40, depth=40, caption="SOFT" ),
    to_connection( "end_b9", "soft1"),

    to_end() 
    ]

def main():
    namefile = str(sys.argv[0]).split('.')[0]
    to_generate(arch, namefile + '.tex' )
if __name__ == '__main__':
    main()

赶紧试试吧!

Github 地址:

https://github.com/HarisIqbal88/PlotNeuralNet

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2019-03-03,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 大数据DT 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档