From cb1f33c6ae840e8dc0f43518daf76e6ed01034f0 Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Mon, 08 Dec 2014 19:48:57 +0000
Subject: [PATCH] Fixed race condition in server
---
src/activations.h | 31 ++++++++++++++++++++++---------
1 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/src/activations.h b/src/activations.h
index 294cf28..c406c18 100644
--- a/src/activations.h
+++ b/src/activations.h
@@ -1,10 +1,23 @@
-typedef enum{
- SIGMOID, RELU, IDENTITY
-}ACTIVATOR_TYPE;
+#include "opencl.h"
+#ifndef ACTIVATIONS_H
+#define ACTIVATIONS_H
-double relu_activation(double x);
-double relu_gradient(double x);
-double sigmoid_activation(double x);
-double sigmoid_gradient(double x);
-double identity_activation(double x);
-double identity_gradient(double x);
+typedef enum{
+ SIGMOID, RELU, LINEAR, RAMP, TANH
+}ACTIVATION;
+
+ACTIVATION get_activation(char *s);
+
+char *get_activation_string(ACTIVATION a);
+float activate(float x, ACTIVATION a);
+float gradient(float x, ACTIVATION a);
+void gradient_array(const float *x, const int n, const ACTIVATION a, float *delta);
+void activate_array(float *x, const int n, const ACTIVATION a);
+#ifdef GPU
+cl_kernel get_activation_kernel();
+void activate_array_ongpu(cl_mem x, int n, ACTIVATION a);
+void gradient_array_ongpu(cl_mem x, int n, ACTIVATION a, cl_mem delta);
+#endif
+
+#endif
+
--
Gitblit v1.10.0