From b8eb8b0a4016232c8da95c26501ac60ea9491901 Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Fri, 02 Sep 2016 00:26:12 +0000
Subject: [PATCH] Merge branch 'master' of github.com:pjreddie/darknet
---
src/activation_kernels.cu | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/src/activation_kernels.cu b/src/activation_kernels.cu
index 362d5d7..5d61529 100644
--- a/src/activation_kernels.cu
+++ b/src/activation_kernels.cu
@@ -8,6 +8,18 @@
}
+__device__ float lhtan_activate_kernel(float x)
+{
+ if(x < 0) return .001*x;
+ if(x > 1) return .001*(x-1) + 1;
+ return x;
+}
+__device__ float lhtan_gradient_kernel(float x)
+{
+ if(x > 0 && x < 1) return 1;
+ return .001;
+}
+
__device__ float hardtan_activate_kernel(float x)
{
if (x < -1) return -1;
@@ -89,6 +101,8 @@
return stair_activate_kernel(x);
case HARDTAN:
return hardtan_activate_kernel(x);
+ case LHTAN:
+ return lhtan_activate_kernel(x);
}
return 0;
}
@@ -120,6 +134,8 @@
return stair_gradient_kernel(x);
case HARDTAN:
return hardtan_gradient_kernel(x);
+ case LHTAN:
+ return lhtan_gradient_kernel(x);
}
return 0;
}
--
Gitblit v1.10.0