水表训练
来源:互联网 发布:无间道 演技 知乎 编辑:程序博客网 时间:2024/04/27 16:37
http://caffe.berkeleyvision.org/gathered/examples/mnist.html
问题: lenet 输出的概率总有一个1
解决方法:用softmax 前面的一层,然后归一化到0-1,好像这个问题还是解决不了。
其实我们需要解决两个问题:
A。输出概率
B. 去掉一些扫出来的明显不是数字的图片,不显示。
现在用前面的一层可以解决输出的概率的问题,但是因为输入任何一个图片就会输出一个0,1 那么如果输入的图片不是数字,那么还是会输出一个比较大的数字。并不能扔掉这些图片。
问一下GQ 这个问题。(回复:
正样本的话最大值输出可以在6000以上,负样本暂时没超过3000 ,暂时先做个阈值 把小的去掉,着实不是一个处理的好方法)
我们主要是训练了三个网络:输出都是0,1
1.用最新的caffe-master 下面 examples 下面的mnist。lenet 的prototxt 是这样的。
name: "LeNet"input: "data"input_shape { dim: 1 dim: 1 dim: 28 dim: 28}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: 20 weight_filler { type: "xavier" } bias_filler { type: "constant" } }}layer { name: "prob" type: "Softmax" bottom: "ip2" top: "prob"}
2. 在网上找的一个mnist的配置文件。输入图片的尺寸是32 *32的
name: "LeNet"input: "data"input_dim: 1input_dim: 1input_dim: 32input_dim: 32layer { name: "conv1" type: "Convolution" bottom: "data" top: "conv1" param { lr_mult: 1 } param { lr_mult: 2 } convolution_param { num_output: 6 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: 16 kernel_size: 10 stride: 1 weight_filler { type: "xavier" } bias_filler { type: "constant" } }}layer { name: "ip1" type: "InnerProduct" bottom: "conv2" top: "ip1" param { lr_mult: 1 } param { lr_mult: 2 } inner_product_param { num_output: 120 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: 84 weight_filler { type: "xavier" } bias_filler { type: "constant" } }}layer { name: "relu2" type: "ReLU" bottom: "ip2" top: "ip2"}layer { name: "ip3" type: "InnerProduct" bottom: "ip2" top: "ip3" param { lr_mult: 1 } param { lr_mult: 2 } inner_product_param { num_output: 20 weight_filler { type: "xavier" } bias_filler { type: "constant" } }}layer { name: "prob" type: "Softmax" bottom: "ip3" top: "prob"}
3. 加了均值之后的mnist为lenet2.
需要注意的问题:
A. 在用matlab 提特征的时候我们要吧prototxt 里面的数字
input_dim: 1input_dim: 1input_dim: 32input_dim: 32B. matlab 提特征的时候,要提那一层的特征把之后的层全去掉。比如我们想要softmax 之前层的特征,要把softmax 这一层全去掉。
0 0
- 水表训练
- 水表多标签训练问题总结
- 水表识别
- 水表项目 水表数字识别率分析
- 水表分类-摘录
- IC卡水表
- 水表(一)
- 水表模型更新--170323
- 网监是如何查水表的?
- 水表图片测试的逻辑
- OpenStreetMap(一):水表警告
- 生活中的定律之水表定律
- 水表气表设计总结(一)
- 超声波流量计和超声波水表的区别
- [cocos2d demo]新科娘收集水表
- RIME无线抄水表系统的优势
- 如何选择合理的抄水表方案
- RIME无线抄水表怎样组织网络
- Linux下Nagios的安装与配置
- struts2+spring+hibernate整合报错解决方案
- Canal ClientExample & Server Quick Start
- [总结]FFMPEG视音频编解码零基础学习方法
- 去哪儿测试工程师笔试面试总结
- 水表训练
- CEF3研究之javascript集成(四
- MFC FlexGrid控件的使用示例
- php正则排除一个域名
- Android中的Context详解
- UVA 1597
- 决策树
- spring配置datasource三种方式
- StrictMode 详解