From 0dab894a5be9f7d10d85e89dea91d02c71bae84d Mon Sep 17 00:00:00 2001
From: Edmond Yoo <hj3yoo@uwaterloo.ca>
Date: Sun, 16 Sep 2018 03:24:45 +0000
Subject: [PATCH] Moving files from MTGCardDetector repo

---
 src/activations.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/activations.c b/src/activations.c
index 0cbb2f5..eab4e23 100644
--- a/src/activations.c
+++ b/src/activations.c
@@ -95,8 +95,16 @@
 void activate_array(float *x, const int n, const ACTIVATION a)
 {
     int i;
-    for(i = 0; i < n; ++i){
-        x[i] = activate(x[i], a);
+    if (a == LINEAR) {}
+    else if (a == LEAKY) {
+        for (i = 0; i < n; ++i) {
+            x[i] = leaky_activate(x[i]);
+        }
+    }
+    else {
+        for (i = 0; i < n; ++i) {
+            x[i] = activate(x[i], a);
+        }
     }
 }
 
@@ -139,5 +147,5 @@
     for(i = 0; i < n; ++i){
         delta[i] *= gradient(x[i], a);
     }
-} 
+}
 

--
Gitblit v1.10.0