From 38bd6ae6ba24fc8c14fd61d1238ae94a983434b3 Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Mon, 20 Jul 2015 23:16:26 +0000
Subject: [PATCH] Better partial function
---
src/network.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/src/network.c b/src/network.c
index c691600..e85dfe9 100644
--- a/src/network.c
+++ b/src/network.c
@@ -10,7 +10,9 @@
#include "convolutional_layer.h"
#include "deconvolutional_layer.h"
#include "detection_layer.h"
+#include "normalization_layer.h"
#include "maxpool_layer.h"
+#include "avgpool_layer.h"
#include "cost_layer.h"
#include "softmax_layer.h"
#include "dropout_layer.h"
@@ -27,6 +29,8 @@
return "connected";
case MAXPOOL:
return "maxpool";
+ case AVGPOOL:
+ return "avgpool";
case SOFTMAX:
return "softmax";
case DETECTION:
@@ -39,6 +43,8 @@
return "cost";
case ROUTE:
return "route";
+ case NORMALIZATION:
+ return "normalization";
default:
break;
}
@@ -66,6 +72,8 @@
forward_convolutional_layer(l, state);
} else if(l.type == DECONVOLUTIONAL){
forward_deconvolutional_layer(l, state);
+ } else if(l.type == NORMALIZATION){
+ forward_normalization_layer(l, state);
} else if(l.type == DETECTION){
forward_detection_layer(l, state);
} else if(l.type == CONNECTED){
@@ -78,6 +86,8 @@
forward_softmax_layer(l, state);
} else if(l.type == MAXPOOL){
forward_maxpool_layer(l, state);
+ } else if(l.type == AVGPOOL){
+ forward_avgpool_layer(l, state);
} else if(l.type == DROPOUT){
forward_dropout_layer(l, state);
} else if(l.type == ROUTE){
@@ -147,8 +157,12 @@
backward_convolutional_layer(l, state);
} else if(l.type == DECONVOLUTIONAL){
backward_deconvolutional_layer(l, state);
+ } else if(l.type == NORMALIZATION){
+ backward_normalization_layer(l, state);
} else if(l.type == MAXPOOL){
if(i != 0) backward_maxpool_layer(l, state);
+ } else if(l.type == AVGPOOL){
+ backward_avgpool_layer(l, state);
} else if(l.type == DROPOUT){
backward_dropout_layer(l, state);
} else if(l.type == DETECTION){
@@ -266,6 +280,11 @@
resize_convolutional_layer(&l, w, h);
}else if(l.type == MAXPOOL){
resize_maxpool_layer(&l, w, h);
+ }else if(l.type == AVGPOOL){
+ resize_avgpool_layer(&l, w, h);
+ break;
+ }else if(l.type == NORMALIZATION){
+ resize_normalization_layer(&l, w, h);
}else{
error("Cannot resize this type of layer");
}
--
Gitblit v1.10.0