【Map】Netscope实践

制图方法

第一章 Netscope绘制深度学习网络模型



一、什么是Netscope?

Netscope用来可视化Caffe结构里prototxt格式的网络结构,可以绘制如AlexNet等深度学习网络结构,是一个在线可视化工具


二、Netscope网址

1、Netscope文档链接
2、Netscope的github链接
3、Netscope在线链接
其中:
1.github连接可以下载.prototxt文件
2.在线连接可以生成网络结构图,操作过程中将.prototxt文件中的文本粘贴至灰色方框中,然后通过按下shift+enter生成图片。NetScope页面


三、Prototxt文件编写介绍

1.模型建立

定义网络名称

name: "CNN"  #定义网络名称

定于输入层

# 定义输入层
layer {
  name: "data"
  type: "Input"
  top: "data"
  input_param { shape: { dim: 10 dim: 3 dim: 227 dim: 227 } } 
  # dim:数量 dim:通道数 dim:长度 dim:宽度
}

定义卷积层和池化层

layer {
  name: "conv1"
  type: "Convolution"
  bottom: "data"  # 上方连接的模块
  top: "conv1"  # 下方连接的模块
  param {
    lr_mult: 0.01  # 学习率
    decay_mult: 0  # 延迟数
  }
  convolution_param {
    num_output: 64  # 输出通道数
    kernel_size: 3  # 卷积核大小
    padding: 1  # 卷积的相关参数 
  }
}
layer {
  name: "relu1"
  type: "ReLU"
  bottom: "conv1"  # 上方同下方连接模块相同
  top: "conv1"  # 因此会同上方连接模块结合
}
layer {
  name: "pool1"
  type: "Pooling"
  bottom: "conv1"  
  top: "pool1"
  pooling_param {
    pool: MAX  # 池化类型
    kernel_size: 3  # 核大小
    stride: 2  # 步长
  }
}

定义全连接层

layer {
  name: "fc2"
  type: "InnerProduct"
  bottom: "pool1"
  top: "fc2"
  param {
    lr_mult: 1
    decay_mult: 1
  }
  param {
    lr_mult: 2
    decay_mult: 0
  }
  inner_product_param {
    num_output: 1  # 输出通道数
  }
}

定义输出层

layer {
  name: "prob"
  type: "Softmax"
  bottom: "fc2"
  top: "prob"
}

网络结构展示

根据上述代码生成的网络结构


总结

Netscope可以绘制深度学习模型,且配色很好看,可以绘制较大模型,但简单模型样式单薄。

  • 9
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值