From d0b9326a352ed2fbc3ae66fdef40b4533a2f211d Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Tue, 11 Aug 2015 06:22:27 +0000
Subject: [PATCH] Hacks to get nightmare to not break gridsizing
---
src/convolutional_layer.h | 43 ++++++++-----------------------------------
1 files changed, 8 insertions(+), 35 deletions(-)
diff --git a/src/convolutional_layer.h b/src/convolutional_layer.h
index eaf1562..7452c3c 100644
--- a/src/convolutional_layer.h
+++ b/src/convolutional_layer.h
@@ -5,43 +5,14 @@
#include "params.h"
#include "image.h"
#include "activations.h"
+#include "layer.h"
-typedef struct {
- int batch;
- int h,w,c;
- int n;
- int size;
- int stride;
- int pad;
- float *filters;
- float *filter_updates;
-
- float *biases;
- float *bias_updates;
-
- float *col_image;
- float *delta;
- float *output;
-
- #ifdef GPU
- float * filters_gpu;
- float * filter_updates_gpu;
-
- float * biases_gpu;
- float * bias_updates_gpu;
-
- float * col_image_gpu;
- float * delta_gpu;
- float * output_gpu;
- #endif
-
- ACTIVATION activation;
-} convolutional_layer;
+typedef layer convolutional_layer;
#ifdef GPU
void forward_convolutional_layer_gpu(convolutional_layer layer, network_state state);
void backward_convolutional_layer_gpu(convolutional_layer layer, network_state state);
-void update_convolutional_layer_gpu(convolutional_layer layer, float learning_rate, float momentum, float decay);
+void update_convolutional_layer_gpu(convolutional_layer layer, int batch, float learning_rate, float momentum, float decay);
void push_convolutional_layer(convolutional_layer layer);
void pull_convolutional_layer(convolutional_layer layer);
@@ -50,10 +21,10 @@
void backward_bias_gpu(float *bias_updates, float *delta, int batch, int n, int size);
#endif
-convolutional_layer *make_convolutional_layer(int batch, int h, int w, int c, int n, int size, int stride, int pad, ACTIVATION activation);
-void resize_convolutional_layer(convolutional_layer *layer, int h, int w);
+convolutional_layer make_convolutional_layer(int batch, int h, int w, int c, int n, int size, int stride, int pad, ACTIVATION activation);
+void resize_convolutional_layer(convolutional_layer *layer, int w, int h);
void forward_convolutional_layer(const convolutional_layer layer, network_state state);
-void update_convolutional_layer(convolutional_layer layer, float learning_rate, float momentum, float decay);
+void update_convolutional_layer(convolutional_layer layer, int batch, float learning_rate, float momentum, float decay);
image *visualize_convolutional_layer(convolutional_layer layer, char *window, image *prev_filters);
void backward_convolutional_layer(convolutional_layer layer, network_state state);
@@ -67,6 +38,8 @@
int convolutional_out_height(convolutional_layer layer);
int convolutional_out_width(convolutional_layer layer);
+void rescale_filters(convolutional_layer l, float scale, float trans);
+void rgbgr_filters(convolutional_layer l);
#endif
--
Gitblit v1.10.0