AlexeyAB
2018-05-06 c9b8bdee1886df5f83973d91c3597c28f99a9e0c
src/region_layer.c
@@ -136,8 +136,9 @@
         int ti = index + class_id;
         float pt = output[ti] + 0.000000000000001F;
         //float grad = -(1 - pt) * (2 * pt*logf(pt) + pt - 1);   // http://blog.csdn.net/linmingan/article/details/77885832
         float grad = (1 - pt) * (2 * pt*logf(pt) + pt - 1);      // https://github.com/unsky/focal-loss
         // http://fooplot.com/#W3sidHlwZSI6MCwiZXEiOiItKDEteCkqKDIqeCpsb2coeCkreC0xKSIsImNvbG9yIjoiIzAwMDAwMCJ9LHsidHlwZSI6MTAwMH1d
         float grad = -(1 - pt) * (2 * pt*logf(pt) + pt - 1);  // http://blog.csdn.net/linmingan/article/details/77885832
         //float grad = (1 - pt) * (2 * pt*logf(pt) + pt - 1); // https://github.com/unsky/focal-loss
         for (n = 0; n < classes; ++n) {
            delta[index + n] = scale * (((n == class_id) ? 1 : 0) - output[index + n]);
@@ -544,7 +545,7 @@
         int class_index = entry_index(l, 0, n*l.w*l.h + i, l.coords + !l.background);
         if (l.softmax_tree) {
            hierarchy_predictions(predictions + class_index, l.classes, l.softmax_tree, 0, l.w*l.h);
            hierarchy_predictions(predictions + class_index, l.classes, l.softmax_tree, 0);// , l.w*l.h);
            if (map) {
               for (j = 0; j < 200; ++j) {
                  int class_index = entry_index(l, 0, n*l.w*l.h + i, l.coords + 1 + map[j]);