counters_per_class affects the objectness too

This commit is contained in:
AlexeyAB 2019-12-25 20:34:24 +03:00
parent b8fe630119
commit 35a3870979
2 changed files with 4 additions and 4 deletions

View File

@ -506,7 +506,7 @@ void forward_gaussian_yolo_layer(const layer l, network_state state)
int obj_index = entry_gaussian_index(l, b, mask_n*l.w*l.h + j*l.w + i, 8);
avg_obj += l.output[obj_index];
l.delta[obj_index] = l.cls_normalizer * (1 - l.output[obj_index]);
l.delta[obj_index] = class_multiplier * l.cls_normalizer * (1 - l.output[obj_index]);
int class_index = entry_gaussian_index(l, b, mask_n*l.w*l.h + j*l.w + i, 9);
delta_gaussian_yolo_class(l.output, l.delta, class_index, class_id, l.classes, l.w*l.h, &avg_cat, l.label_smooth_eps, l.classes_multipliers);
@ -539,7 +539,7 @@ void forward_gaussian_yolo_layer(const layer l, network_state state)
int obj_index = entry_gaussian_index(l, b, mask_n*l.w*l.h + j*l.w + i, 8);
avg_obj += l.output[obj_index];
l.delta[obj_index] = l.cls_normalizer * (1 - l.output[obj_index]);
l.delta[obj_index] = class_multiplier * l.cls_normalizer * (1 - l.output[obj_index]);
int class_index = entry_gaussian_index(l, b, mask_n*l.w*l.h + j*l.w + i, 9);
delta_gaussian_yolo_class(l.output, l.delta, class_index, class_id, l.classes, l.w*l.h, &avg_cat, l.label_smooth_eps, l.classes_multipliers);

View File

@ -423,7 +423,7 @@ void forward_yolo_layer(const layer l, network_state state)
int obj_index = entry_index(l, b, mask_n*l.w*l.h + j*l.w + i, 4);
avg_obj += l.output[obj_index];
l.delta[obj_index] = l.cls_normalizer * (1 - l.output[obj_index]);
l.delta[obj_index] = class_multiplier * l.cls_normalizer * (1 - l.output[obj_index]);
int class_index = entry_index(l, b, mask_n*l.w*l.h + j*l.w + i, 4 + 1);
delta_yolo_class(l.output, l.delta, class_index, class_id, l.classes, l.w*l.h, &avg_cat, l.focal_loss, l.label_smooth_eps, l.classes_multipliers);
@ -467,7 +467,7 @@ void forward_yolo_layer(const layer l, network_state state)
int obj_index = entry_index(l, b, mask_n*l.w*l.h + j*l.w + i, 4);
avg_obj += l.output[obj_index];
l.delta[obj_index] = l.cls_normalizer * (1 - l.output[obj_index]);
l.delta[obj_index] = class_multiplier * l.cls_normalizer * (1 - l.output[obj_index]);
int class_index = entry_index(l, b, mask_n*l.w*l.h + j*l.w + i, 4 + 1);
delta_yolo_class(l.output, l.delta, class_index, class_id, l.classes, l.w*l.h, &avg_cat, l.focal_loss, l.label_smooth_eps, l.classes_multipliers);