aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/cl_kernels/activation_layer.cl
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2017-07-12 16:12:12 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-09-17 14:16:42 +0100
commit579c0498e161215be1a36080b0b454e5198a992a (patch)
tree1ec07b602935e7261a8a7aea900dc925e9bc35a1 /src/core/CL/cl_kernels/activation_layer.cl
parent81f0d15d6840a0ae8ef571114555a26da74c4a43 (diff)
downloadComputeLibrary-579c0498e161215be1a36080b0b454e5198a992a.tar.gz
COMPMID-417: Add Leaky RELU support for both NEON/CL.
-Adds parametrizable leaky relu (x>0) ? x : a*x. Change-Id: Ief19a435b5832a30b56f4aaaf55125787addee94 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/80575 Reviewed-by: Anthony Barbier <anthony.barbier@arm.com> Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Diffstat (limited to 'src/core/CL/cl_kernels/activation_layer.cl')
-rw-r--r--src/core/CL/cl_kernels/activation_layer.cl5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/CL/cl_kernels/activation_layer.cl b/src/core/CL/cl_kernels/activation_layer.cl
index 5f812cf5b3..9f958610d6 100644
--- a/src/core/CL/cl_kernels/activation_layer.cl
+++ b/src/core/CL/cl_kernels/activation_layer.cl
@@ -76,6 +76,11 @@ inline TYPE brelu_op(TYPE x)
{
return min((TYPE)A_VAL, max(0, x));
}
+// Leaky RELU Activation
+inline TYPE lrelu_op(TYPE x)
+{
+ return select(MUL_OP((TYPE)A_VAL, x), x, x > (TYPE)0);
+}
// Soft RELU Activation
inline TYPE srelu_op(TYPE x)
{