深度学习_caffe (4) 基于mnist实例搭建新的神经网络&在caffe中添加层(续1)
2016-05-23 10:22
841 查看
如何在caffe中添加层:
http://blog.sciencenet.cn/home.php?mod=space&uid=1583812&do=blog&id=850247
/article/3710391.html
怎么在caffe中配置每一个层的结构:
http://www.myexception.cn/other/1828071.html
上一篇 看到了lenet_solver.prototxt
其中net: “examples/mnist/lenet_train_test.prototxt”指定了网络模型,打开lenet_train_test.prototxt看一下
全是一层一层的定义,也就是神经网络模型各个层的组合方式声明。
关于这些层结构的参数和详细解释 可以参考caffe官网给出的资料。/article/10561720.html
看到这里可以回顾一下
运行mnist
首先是运行一个.sh文件
time sh examples/mnist/train_lenet.sh
然后.sh文件里是 solver.prototxt文件
solver.prototxt 里面定义了 net 和一些迭代什么的 参数
net是由 另一个prototxt文件详细定义的。
所以到目前为止 如果要仿写模型的话 可以先写好这三个文件夹。搭好框架 然后再最后一个prototxt中 调用各个层 组合自己的模型就好了。
http://blog.sciencenet.cn/home.php?mod=space&uid=1583812&do=blog&id=850247
/article/3710391.html
怎么在caffe中配置每一个层的结构:
http://www.myexception.cn/other/1828071.html
上一篇 看到了lenet_solver.prototxt
其中net: “examples/mnist/lenet_train_test.prototxt”指定了网络模型,打开lenet_train_test.prototxt看一下
name: "LeNet" layer { name: "mnist" type: "Data" top: "data" top: "label" include { phase: TRAIN } transform_param { scale: 0.00390625 } data_param { source: "examples/mnist/mnist_train_lmdb" batch_size: 64 backend: LMDB } } layer { name: "mnist" type: "Data" top: "data" top: "label" include { phase: TEST } transform_param { scale: 0.00390625 } data_param { source: "examples/mnist/mnist_test_lmdb" batch_size: 100 backend: LMDB } } layer { name: "conv1" type: "Convolution" bottom: "data" top: "conv1" param { lr_mult: 1 } param { lr_mult: 2 } convolution_param { num_output: 20 kernel_size: 5 stride: 1 weight_filler { type: "xavier" } bias_filler { type: "constant" } } } layer { name: "pool1" type: "Pooling" bottom: "conv1" top: "pool1" pooling_param { pool: MAX kernel_size: 2 stride: 2 } } layer { name: "conv2" type: "Convolution" bottom: "pool1" top: "conv2" param { lr_mult: 1 } param { lr_mult: 2 } convolution_param { num_output: 50 kernel_size: 5 stride: 1 weight_filler { type: "xavier" } bias_filler { type: "constant" } } } layer { name: "pool2" type: "Pooling" bottom: "conv2" top: "pool2" pooling_param { pool: MAX kernel_size: 2 stride: 2 } } layer { name: "ip1" type: "InnerProduct" bottom: "pool2" top: "ip1" param { lr_mult: 1 } param { lr_mult: 2 } inner_product_param { num_output: 500 weight_filler { type: "xavier" } bias_filler { type: "constant" } } } layer { name: "relu1" type: "ReLU" bottom: "ip1" top: "ip1" } layer { name: "ip2" type: "InnerProduct" bottom: "ip1" top: "ip2" param { lr_mult: 1 } param { lr_mult: 2 } inner_product_param { num_output: 10 weight_filler { type: "xavier" } bias_filler { type: "constant" } } } layer { name: "accuracy" type: "Accuracy" bottom: "ip2" bottom: "label" top: "accuracy" include { phase: TEST } } layer { name: "loss" type: "SoftmaxWithLoss" bottom: "ip2" bottom: "label" top: "loss" }
全是一层一层的定义,也就是神经网络模型各个层的组合方式声明。
关于这些层结构的参数和详细解释 可以参考caffe官网给出的资料。/article/10561720.html
看到这里可以回顾一下
运行mnist
首先是运行一个.sh文件
time sh examples/mnist/train_lenet.sh
然后.sh文件里是 solver.prototxt文件
solver.prototxt 里面定义了 net 和一些迭代什么的 参数
net是由 另一个prototxt文件详细定义的。
所以到目前为止 如果要仿写模型的话 可以先写好这三个文件夹。搭好框架 然后再最后一个prototxt中 调用各个层 组合自己的模型就好了。
相关文章推荐
- php----http协议 Cookie个人总结
- HTTPS加密传输数据,加强P2P平台网络安全和信任
- 端口映射的实现方法之花生壳动态域名详解
- 封装了okhttp的网络框架,支持大文件上传下载,上传进度...
- TCP协议详解
- 网络与通信:网络设备(概念)
- IP:网际协议
- HTTPS加密传输数据,加强P2P平台网络安全和信任
- 二进制传输 文本传输
- SpringMVC 重写HttpMessageConverter进行Xss过滤
- HttpURLConnection下载文件
- http状态码及含义
- 网络编程-TCP连接-length
- HttpURLConnection发送post请求信息
- UNIX网络编程 1-2章学习笔记
- http状态码
- 网络编程-TCP连接-readLine
- SSL证书(HTTPS)背后的加密算法
- SSL证书(HTTPS)背后的加密算法
- 网络编程-http连接-GET&POST