diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/GLES_COMPUTE/cs_shaders/activation_layer.cs | 7 | ||||
-rw-r--r-- | src/core/GLES_COMPUTE/cs_shaders/activation_layer_helpers_cs.h | 8 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/core/GLES_COMPUTE/cs_shaders/activation_layer.cs b/src/core/GLES_COMPUTE/cs_shaders/activation_layer.cs index 9a1e233624..dd97c1501b 100644 --- a/src/core/GLES_COMPUTE/cs_shaders/activation_layer.cs +++ b/src/core/GLES_COMPUTE/cs_shaders/activation_layer.cs @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 ARM Limited. + * Copyright (c) 2017-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -77,6 +77,8 @@ void main(void) data_out = sqrt_op(data); #elif defined(LINEAR) /*LINEAR*/ data_out = linear_op(data); +#elif defined(IDENTITY) /*IDENTITY*/ + data_out = identity_op(data); #else /*LOGISTIC*/ #error Activation function not provided #endif /*LOGISTIC*/ @@ -131,6 +133,9 @@ void main(void) #elif defined(LINEAR) /*LINEAR*/ data_out.x = linear_op(a); data_out.y = linear_op(b); +#elif defined(IDENTITY) /*IDENTITY*/ + data_out.x = identity_op(a); + data_out.y = identity_op(b); #else /*LOGISTIC*/ #error Activation function not provided #endif /*LOGISTIC*/ diff --git a/src/core/GLES_COMPUTE/cs_shaders/activation_layer_helpers_cs.h b/src/core/GLES_COMPUTE/cs_shaders/activation_layer_helpers_cs.h index f43a33fe87..e5a89a830f 100644 --- a/src/core/GLES_COMPUTE/cs_shaders/activation_layer_helpers_cs.h +++ b/src/core/GLES_COMPUTE/cs_shaders/activation_layer_helpers_cs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 ARM Limited. + * Copyright (c) 2018-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -117,3 +117,9 @@ float linear_op(float x) { return MLA_OP(float(B_VAL), float(A_VAL), x); } + +// Linear Activation +float identity_op(float x) +{ + return x; +} |