![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Caffe
zzqiuzz
The future is independent of the past given the present.
展开
-
Caffe源码:Softmax_loss_layer.cpp
@brief: Caffe损失层反向传播上图是LeNet中前向传播的最后一层,也是反向传播的第一层。SoftmaxLayer作用是将网络的最后一层ip2的10个输出神经元zi(i∈(1,10))z_i (i\in(1,10))通过函数ff 由浮点数映射到[0,1]之间的概率值,ff 的具体形式为f(zy)=ezy−m∑10iezi−mf(z_y)=\frac{e^{z_y-m}}{\sum_i^{原创 2017-12-05 20:57:31 · 432 阅读 · 0 评论 -
Caffe源码:conv_im2col
写在前头:一天下来到现在什么都没干,下午还来一烦心事,真心感到是浪费时间浪费生命,赶紧写篇博客压压惊。因为现在在看caffe源码,目前正进行到卷积层的前向传播部分。因此本篇博客着重理解im2col.cpp中的im2col_cpu部分代码,在理解caffe中实现卷积的思想后Conv in caffe,对代码理解进行记录。 可以知道:卷积操作的输入featuremap(包括图像)是一个三维张量(CxH原创 2017-11-30 19:21:58 · 603 阅读 · 0 评论 -
Caffe源码:inner_product_layer.cpp
@brief: Caffe全连接层ip2–>ip1反向传播(不包含ReluLayer) 以LeNet全连接层反向传播为例,ip2–>ip1,如图示,输入神经元个数500,输出神经元个数10,batchsize为64,则要更新的权重矩阵为500x10。 对每一个输出神经元 yi=∑djwji∗xj+biasmultiplier∗bi,∴∂yi∂wji=xj y_i=\sum _j^dw_{ji}原创 2017-12-06 21:13:04 · 550 阅读 · 0 评论 -
Caffe源码:relu_layer.cpp
@brief ReluLayer层反向传播Relu激活函数:f(x)=max(0,x)f(x)=\max (0,x)top_data={bottom_data,0,if bottom_data>0if bottom_data≤0 top\_data = \begin{cases} bottom\_data, & \text{if $bottom\_d原创 2017-12-07 14:55:48 · 244 阅读 · 0 评论 -
Caffe源码:pooling_layer.cpp
@brief PoolingLayer层反向传播conv2–>pool2只将梯度传到贡献损失的神经元即max\max所在的神经元索引 核心代码: bottom_diff[bottom_index] += top_diff[index];//计算梯度并更新原始bottom_diff主体代码#include <algorithm> #include <cfloat> #include <vector>原创 2017-12-07 22:17:26 · 493 阅读 · 0 评论 -
Caffe源码:image_classification.cpp
@brief:测试训练好的caffemodel Vs2013+caffe+cpu这里deploy.prototxt中的input:”data”由caffe的upgrade_protp.cpp 自动转化为输入层。原创 2017-12-28 22:16:10 · 273 阅读 · 0 评论 -
Caffe References(updating)
@brief Useful references with respect to debugging & overwriting Caffe source code. Optimization: Stochastic Gradient Descent: http://ufldl.stanford.edu/tutorial/supervised/OptimizationStochastic原创 2017-12-09 14:27:05 · 168 阅读 · 0 评论