softmax层可以输出loss函数或者计算此时的准确率情况
对于loss的计算
通过上面的函数来实现一个归一化的操作,那么此时函数得到的结果就范围就是咋(0-1)之间,得出概率值
layer{
name:“loss”
type:“SoftmaxWithLoss”
bottom:“ip1”
bottom:“label”
top:“loss”
}
输出prob
layer{
name:“prob”
type:“Softmax”
bottom:“ip2”
bottom:“label”
top:“prob”
}
reshape层
在不改变数据的情况下改变输入数据的维度
layer{
name:“reshape”
type:“Reshape”
bottom:“input”
top:“output”
reshape_param{
shape{dim:0
dim:2
dim:3
dim:-1
}
#0表示维度不变,就是输入和输出是同一个维度的
#-1表示通过系统计算得到维度剩下的维度的大小
#dim:2或者dim:3表示说维度变化成2或者3
#假设有一些数据的格式类型为3232828,表示有32张3通道的2828的数据
#那么此时我想要把他变化成为32314*56的数据
#那么此时的reshape_param{
shape{
dim:0
dim:0
dim:14
dim:-1
}
}
}
dropout 层
防止神经网络过拟合
layer{
name:“drop7”
type:“Dropout”
bottom:“ip7”
top:“ip7”
dropout_param{
dropout_ratio:0.5#杀死多少的神经元,防止出现神经网络过拟合现象
}
}
在letnet模型中神经层
两个数据层。一个train用的,一个是test用的
后接卷积层1
接池化层1
卷积层2
池化层2
全连接层
accuracy
loss