From c7b10ceadb1a78e7480d281444a31ae2a7dc1b05 Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Fri, 06 May 2016 23:25:16 +0000
Subject: [PATCH] so much need to commit
---
src/darknet.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/src/darknet.c b/src/darknet.c
index 0865c61..f2982ac 100644
--- a/src/darknet.c
+++ b/src/darknet.c
@@ -6,6 +6,7 @@
#include "utils.h"
#include "cuda.h"
#include "blas.h"
+#include "connected_layer.h"
#ifdef OPENCV
#include "opencv2/highgui/highgui_c.h"
@@ -182,6 +183,25 @@
denormalize_convolutional_layer(l);
net.layers[i].batch_normalize=0;
}
+ if (l.type == CONNECTED && l.batch_normalize) {
+ denormalize_connected_layer(l);
+ net.layers[i].batch_normalize=0;
+ }
+ if (l.type == GRU && l.batch_normalize) {
+ denormalize_connected_layer(*l.input_z_layer);
+ denormalize_connected_layer(*l.input_r_layer);
+ denormalize_connected_layer(*l.input_h_layer);
+ denormalize_connected_layer(*l.state_z_layer);
+ denormalize_connected_layer(*l.state_r_layer);
+ denormalize_connected_layer(*l.state_h_layer);
+ l.input_z_layer->batch_normalize = 0;
+ l.input_r_layer->batch_normalize = 0;
+ l.input_h_layer->batch_normalize = 0;
+ l.state_z_layer->batch_normalize = 0;
+ l.state_r_layer->batch_normalize = 0;
+ l.state_h_layer->batch_normalize = 0;
+ net.layers[i].batch_normalize=0;
+ }
}
save_weights(net, outfile);
}
--
Gitblit v1.10.0