From 989ab8c38a02fa7ea9c25108151736c62e81c972 Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Fri, 24 Apr 2015 17:27:50 +0000
Subject: [PATCH] IOU loss function
---
src/parser.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/parser.c b/src/parser.c
index 6ff978c..0f13d77 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -165,8 +165,9 @@
int coords = option_find_int(options, "coords", 1);
int classes = option_find_int(options, "classes", 1);
int rescore = option_find_int(options, "rescore", 1);
+ int nuisance = option_find_int(options, "nuisance", 0);
int background = option_find_int(options, "background", 1);
- detection_layer *layer = make_detection_layer(params.batch, params.inputs, classes, coords, rescore, background);
+ detection_layer *layer = make_detection_layer(params.batch, params.inputs, classes, coords, rescore, background, nuisance);
option_unused(options);
return layer;
}
@@ -185,6 +186,9 @@
int crop_height = option_find_int(options, "crop_height",1);
int crop_width = option_find_int(options, "crop_width",1);
int flip = option_find_int(options, "flip",0);
+ float angle = option_find_float(options, "angle",0);
+ float saturation = option_find_float(options, "saturation",1);
+ float exposure = option_find_float(options, "exposure",1);
int batch,h,w,c;
h = params.h;
@@ -193,7 +197,7 @@
batch=params.batch;
if(!(h && w && c)) error("Layer before crop layer must output image.");
- crop_layer *layer = make_crop_layer(batch,h,w,c,crop_height,crop_width,flip);
+ crop_layer *layer = make_crop_layer(batch,h,w,c,crop_height,crop_width,flip, angle, saturation, exposure);
option_unused(options);
return layer;
}
@@ -550,7 +554,7 @@
void print_detection_cfg(FILE *fp, detection_layer *l, network net, int count)
{
fprintf(fp, "[detection]\n");
- fprintf(fp, "classes=%d\ncoords=%d\nrescore=%d\n", l->classes, l->coords, l->rescore);
+ fprintf(fp, "classes=%d\ncoords=%d\nrescore=%d\nnuisance=%d\n", l->classes, l->coords, l->rescore, l->nuisance);
fprintf(fp, "\n");
}
@@ -619,6 +623,7 @@
fread(&net->momentum, sizeof(float), 1, fp);
fread(&net->decay, sizeof(float), 1, fp);
fread(&net->seen, sizeof(int), 1, fp);
+ fprintf(stderr, "%f %f %f %d\n", net->learning_rate, net->momentum, net->decay, net->seen);
int i;
for(i = 0; i < net->n && i < cutoff; ++i){
--
Gitblit v1.10.0