From eb46166f1130d6c6fb5d41d6090a86b35d1542fc Mon Sep 17 00:00:00 2001
From: Edmond Yoo <hj3yoo@uwaterloo.ca>
Date: Thu, 06 Sep 2018 17:31:12 +0000
Subject: [PATCH] merge resolution
---
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