From aa5996d58e68edfbefe51061856aecd549dd09c4 Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Tue, 13 Jan 2015 01:27:08 +0000
Subject: [PATCH] Faster
---
src/activations.h | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/activations.h b/src/activations.h
index 15d96d3..c406c18 100644
--- a/src/activations.h
+++ b/src/activations.h
@@ -1,14 +1,23 @@
+#include "opencl.h"
#ifndef ACTIVATIONS_H
#define ACTIVATIONS_H
typedef enum{
- SIGMOID, RELU, IDENTITY, RAMP
+ SIGMOID, RELU, LINEAR, RAMP, TANH
}ACTIVATION;
ACTIVATION get_activation(char *s);
-double activate(double x, ACTIVATION a);
-double gradient(double x, ACTIVATION a);
+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