From 664c5dd2f2d1c4ad177d5122df6ce3e2900c6648 Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Sun, 22 Mar 2015 16:56:40 +0000
Subject: [PATCH] Subdivisions for batches

---
 src/parser.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/parser.c b/src/parser.c
index d7c4a31..6ff978c 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -165,7 +165,8 @@
     int coords = option_find_int(options, "coords", 1);
     int classes = option_find_int(options, "classes", 1);
     int rescore = option_find_int(options, "rescore", 1);
-    detection_layer *layer = make_detection_layer(params.batch, params.inputs, classes, coords, rescore);
+    int background = option_find_int(options, "background", 1);
+    detection_layer *layer = make_detection_layer(params.batch, params.inputs, classes, coords, rescore, background);
     option_unused(options);
     return layer;
 }
@@ -248,12 +249,16 @@
     net->momentum = option_find_float(options, "momentum", .9);
     net->decay = option_find_float(options, "decay", .0001);
     net->seen = option_find_int(options, "seen",0);
+    int subdivs = option_find_int(options, "subdivisions",1);
+    net->batch /= subdivs;
+    net->subdivisions = subdivs;
 
     net->h = option_find_int_quiet(options, "height",0);
     net->w = option_find_int_quiet(options, "width",0);
     net->c = option_find_int_quiet(options, "channels",0);
     net->inputs = option_find_int_quiet(options, "inputs", net->h * net->w * net->c);
     if(!net->inputs && !(net->h && net->w && net->c)) error("No input parameters supplied");
+    option_unused(options);
 }
 
 network parse_network_cfg(char *filename)

--
Gitblit v1.10.0