Pixel probability in the softmax_loss_layer.cpp file.

59 views
Skip to first unread message

ChangHyun Kim

unread,
Feb 6, 2015, 2:25:30 AM2/6/15
to caffe...@googlegroups.com
Dear coffee lovers,
 
Do you know the pixel index of the "prob_data" parameter in the softmax_loss_layer.cpp file?
 
In the Forward_cpu() function, there is a parameter "prob_data = prob_.cpu_data();" and
 
loss is defined as follows;
 
loss -= log(std::max(prob_data[i*dim+static_cast<int>(label[i*spatial_dim+j])*spartial_dim+j], Dtype(FLT_MIN))
 
Here I don't understand the sequence of the neighbor pixel index.
For example, there are nine pixels and we want to calculate the whole 8 neighbor nodes' indexes.
 
Could you give me the index when the center is ? 5 = i*dim+static_cast<int>(label[i*spatial_dim+j])*spartial_dim+j.
 
I actually don't know which own is correact?
 
1 2 3                 1 4 7
4 5 6   or           2 5  8 
7 8 9                 3 6 9       
(1 2 3 4 5 6 7 8 9) or (1 4 7 2 5 8 3 6 9)
Sincerely yours
Changhyun Kim
 
Reply all
Reply to author
Forward
0 new messages