2 // Copyright (c) 2018 Intel Corporation
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 ///////////////////////////////////////////////////////////////////////////////////////////////////
20 /// @addtogroup c_api C API
22 /// @addtogroup c_topology Network Topology
24 /// @addtogroup c_primitives Primitives
31 /// @brief Activation gradient for rectified linear unit or parameterized rectified linear unit.
33 /// out(i,x,y) = input_gradient(i,x,y) * ((input(i,x,y) > 0) + slope(i) * (input(i,x,y) <= 0)
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)
49 CLDNN_DECLARE_PRIMITIVE_TYPE_ID(activation_grad);