Skip to content

Commit

Permalink
Use default gradient for new_coords=1
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyAB committed Dec 4, 2020
1 parent 8d6e56e commit 4709f61
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/yolo_layer.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ ious delta_yolo_box(box truth, float *x, float *biases, int n, int index, int i,
float dw = all_ious.dx_iou.dl;
float dh = all_ious.dx_iou.dr;

/*
// predict exponential, apply gradient of e^delta_t ONLY for w,h
if (new_coords) {
dw *= 8 * x[index + 2 * stride] * biases[2 * n] / w;
Expand All @@ -244,6 +245,10 @@ ious delta_yolo_box(box truth, float *x, float *biases, int n, int index, int i,
dw *= exp(x[index + 2 * stride]);
dh *= exp(x[index + 3 * stride]);
}
*/

dw *= exp(x[index + 2 * stride]);
dh *= exp(x[index + 3 * stride]);

// normalize iou weight
dx *= iou_normalizer;
Expand Down

0 comments on commit 4709f61

Please sign in to comment.