From 1b5afb45838e603fa6780762eb8cc59246dc2d81 Mon Sep 17 00:00:00 2001
From: IlyaOvodov <b@ovdv.ru>
Date: Tue, 08 May 2018 11:09:35 +0000
Subject: [PATCH] Output improvements for detector results: When printing detector results, output was done in random order, obfuscating results for interpreting. Now: 1. Text output includes coordinates of rects in (left,right,top,bottom in pixels) along with label and score 2. Text output is sorted by rect lefts to simplify finding appropriate rects on image 3. If several class probs are > thresh for some detection, the most probable is written first and coordinates for others are not repeated 4. Rects are imprinted in image in order by their best class prob, so most probable rects are always on top and not overlayed by less probable ones 5. Most probable label for rect is always written first Also: 6. Message about low GPU memory include required amount

---
 src/convolutional_layer.h |   58 +++++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 37 insertions(+), 21 deletions(-)

diff --git a/src/convolutional_layer.h b/src/convolutional_layer.h
index ab414ec..6d1e517 100644
--- a/src/convolutional_layer.h
+++ b/src/convolutional_layer.h
@@ -1,37 +1,53 @@
 #ifndef CONVOLUTIONAL_LAYER_H
 #define CONVOLUTIONAL_LAYER_H
 
+#include "cuda.h"
 #include "image.h"
 #include "activations.h"
+#include "layer.h"
+#include "network.h"
 
-typedef struct {
-    int h,w,c;
-    int n;
-    int stride;
-    image *kernels;
-    image *kernel_updates;
-    double *biases;
-    double *bias_updates;
-    image upsampled;
-    double *delta;
-    double *output;
+typedef layer convolutional_layer;
 
-    double (* activation)();
-    double (* gradient)();
-} 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, int batch, float learning_rate, float momentum, float decay);
 
-convolutional_layer *make_convolutional_layer(int h, int w, int c, int n, int size, int stride, ACTIVATION activator);
-void forward_convolutional_layer(const convolutional_layer layer, double *in);
-void backward_convolutional_layer(convolutional_layer layer, double *input, double *delta);
-void learn_convolutional_layer(convolutional_layer layer, double *input);
+void push_convolutional_layer(convolutional_layer layer);
+void pull_convolutional_layer(convolutional_layer layer);
 
-void update_convolutional_layer(convolutional_layer layer, double step);
+void add_bias_gpu(float *output, float *biases, int batch, int n, int size);
+void backward_bias_gpu(float *bias_updates, float *delta, int batch, int n, int size);
+#ifdef CUDNN
+void cudnn_convolutional_setup(layer *l, int cudnn_preference);
+void cuda_convert_f32_to_f16(float* input_f32, size_t size, float *output_f16);
+#endif
+#endif
 
-void backpropagate_convolutional_layer_convolve(image input, convolutional_layer layer);
-void visualize_convolutional_layer(convolutional_layer layer);
+convolutional_layer make_convolutional_layer(int batch, int h, int w, int c, int n, int size, int stride, int padding, ACTIVATION activation, int batch_normalize, int binary, int xnor, int adam);
+void denormalize_convolutional_layer(convolutional_layer l);
+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, int batch, float learning_rate, float momentum, float decay);
+image *visualize_convolutional_layer(convolutional_layer layer, char *window, image *prev_weights);
+void binarize_weights(float *weights, int n, int size, float *binary);
+void swap_binary(convolutional_layer *l);
+void binarize_weights2(float *weights, int n, int size, char *binary, float *scales);
+
+void backward_convolutional_layer(convolutional_layer layer, network_state state);
+
+void add_bias(float *output, float *biases, int batch, int n, int size);
+void backward_bias(float *bias_updates, float *delta, int batch, int n, int size);
 
 image get_convolutional_image(convolutional_layer layer);
 image get_convolutional_delta(convolutional_layer layer);
+image get_convolutional_weight(convolutional_layer layer, int i);
+
+int convolutional_out_height(convolutional_layer layer);
+int convolutional_out_width(convolutional_layer layer);
+void rescale_weights(convolutional_layer l, float scale, float trans);
+void rgbgr_weights(convolutional_layer l);
 
 #endif
 

--
Gitblit v1.10.0