Publishing 2019 R2 content (#223)
[platform/upstream/dldt.git] / inference-engine / thirdparty / clDNN / api / C / activation_grad.h
1 /*
2 // Copyright (c) 2018 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //      http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 */
16
17 ///////////////////////////////////////////////////////////////////////////////////////////////////
18 #pragma once
19 #include "cldnn.h"
20 /// @addtogroup c_api C API
21 /// @{
22 /// @addtogroup c_topology Network Topology
23 /// @{
24 /// @addtogroup c_primitives Primitives
25 /// @{
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 /// @brief Activation gradient for rectified linear unit or parameterized rectified linear unit.
32 /// @par Algorithm:
33 ///   out(i,x,y) = input_gradient(i,x,y) * ((input(i,x,y) > 0) + slope(i)  * (input(i,x,y) <= 0)
34 /// @par Where:
35 ///   @li out(i,x,y) : value at x, y from i-th feature map after activation.
36 ///   @li in(i,x,y) : value at x, y from i-th feature map before activation.
37 ///   @li slope(i) : the slope value of the i-th feature map (can be shared across channels or one slope per channel).
38 CLDNN_BEGIN_PRIMITIVE_DESC(activation_grad)
39 /// @brief activation gradient function.
40 cldnn_activation_grad_func activation_grad_func;
41 /// @brief Activation additional params.
42 /// activation_relu_negative_slope_grad  - additional_params.a is a negative slope
43 cldnn_activation_additional_params additional_params;
44 /// @brief Activation additional params stored on a memory object
45 /// activation_relu_negative_slope_grad  - negative slope per feature map
46 cldnn_primitive_id additional_params_input;
47 CLDNN_END_PRIMITIVE_DESC(activation_grad)
48
49 CLDNN_DECLARE_PRIMITIVE_TYPE_ID(activation_grad);
50
51 #ifdef __cplusplus
52 }
53 #endif
54
55 /// @}
56 /// @}
57 /// @}
58