caffe-yolo-9000
caffe-yolo-9000 copied to clipboard
get_region_box doesn't appear to be using sigmoid
The get_region_box function in yolo_v2_loss_layer.cpp doesn't appear to be using sigmoid to compute box.x and box.y. I wonder why? The logistic_activate() function is defined by never called.
//why aren't we use sigmoid for box.x and box.y?
box.x = (i + x[0 * SIZE]) / side;
box.y = (j + x[1 * SIZE]) / side;
box.w = exp(x[2 * SIZE]) * biases[2 * n];
box.h = exp(x[3 * SIZE]) * biases[2 * n + 1];
I checked the ground truth label conversion steps. The ground truth values seem to be used just as normalized x, y values relative to image size. There doesn't appear to be any conversion in box_data_layer.cpp either. So how can we use the prediction value without applying sigmoid, in the mix with a linear ground truth to compute the diff?
Is it because the way the diff gradient formula is written in delta_region_box()?
that because the sigmoid function on my data will make loss to nan so i differentiate the loss function
origin function
my loss function