Fixed a bug in counters_per_class=

This commit is contained in:
AlexeyAB 2019-12-18 03:53:40 +03:00
parent e33ecb785e
commit e43a1c424d
3 changed files with 3 additions and 3 deletions

View File

@ -1545,7 +1545,7 @@ data load_data_augment(char **paths, int n, int m, char **labels, int k, tree *h
int i, j; int i, j;
for (i = 0; i < d2.X.rows; ++i) { for (i = 0; i < d2.X.rows; ++i) {
if (mixup == 4) mixup = rand_int(2, 3); // alternate MixUp and CutMix if (mixup == 4) mixup = rand_int(2, 3); // alternate CutMix and Mosaic
// MixUp ----------------------------------- // MixUp -----------------------------------
if (mixup == 1) { if (mixup == 1) {

View File

@ -341,7 +341,7 @@ void delta_gaussian_yolo_class(float *output, float *delta, int index, int class
} }
for(n = 0; n < classes; ++n){ for(n = 0; n < classes; ++n){
delta[index + stride*n] = ((n == class_id) ? (1 - label_smooth_eps) : (0 + label_smooth_eps/classes)) - output[index + stride*n]; delta[index + stride*n] = ((n == class_id) ? (1 - label_smooth_eps) : (0 + label_smooth_eps/classes)) - output[index + stride*n];
if (classes_multipliers) delta[index + stride*class_id] *= classes_multipliers[class_id]; if (classes_multipliers && n == class_id) delta[index + stride*class_id] *= classes_multipliers[class_id];
if(n == class_id && avg_cat) *avg_cat += output[index + stride*n]; if(n == class_id && avg_cat) *avg_cat += output[index + stride*n];
} }
} }

View File

@ -250,7 +250,7 @@ void delta_yolo_class(float *output, float *delta, int index, int class_id, int
// default // default
for (n = 0; n < classes; ++n) { for (n = 0; n < classes; ++n) {
delta[index + stride*n] = ((n == class_id) ? (1 - label_smooth_eps) : (0 + label_smooth_eps/classes)) - output[index + stride*n]; delta[index + stride*n] = ((n == class_id) ? (1 - label_smooth_eps) : (0 + label_smooth_eps/classes)) - output[index + stride*n];
if (classes_multipliers) delta[index + stride*class_id] *= classes_multipliers[class_id]; if (classes_multipliers && n == class_id) delta[index + stride*class_id] *= classes_multipliers[class_id];
if (n == class_id && avg_cat) *avg_cat += output[index + stride*n]; if (n == class_id && avg_cat) *avg_cat += output[index + stride*n];
} }
} }