Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / clDNN / api / C / batch_norm.h
1 /*
2 // Copyright (c) 2016 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 #ifndef BATCH_NORM_H
19 #define BATCH_NORM_H
20
21 #include "cldnn.h"
22 /// @addtogroup c_api C API
23 /// @{
24 /// @addtogroup c_topology Network Topology
25 /// @{
26 /// @addtogroup c_primitives Primitives
27 /// @{
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 /// @brief Batch normalization primitive.
34 /// @details Performs batch normalization as described in
35 /// "Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift" by Ioffe, Szegedy
36 /// @n See: http://arxiv.org/abs/1502.03167
37 /// 
38 /// <b>Algorithm:</b>
39 /// @n global stats can be computed as:
40 /// @n out[i] = ( (in[i] - mean[b]) / sqrt(variance[b] + epsilon) ) * scale[b] + shift[b]
41
42 CLDNN_BEGIN_PRIMITIVE_DESC(batch_norm)
43 /// @brief Primitive id containing mean data.
44 cldnn_primitive_id mean;
45 /// @brief Primitive id containing variance.
46 cldnn_primitive_id variance;
47 /// @brief Primitive id containing scale.
48 cldnn_primitive_id scale;
49 /// @brief Primitive id containing shift.
50 cldnn_primitive_id shift;
51 /// @brief Primitive id containing inverted variance used in future gradient computing.
52 cldnn_primitive_id inv_variance;
53 /// @brief Epsilon.
54 float epsilon;
55 CLDNN_END_PRIMITIVE_DESC(batch_norm)
56
57 CLDNN_DECLARE_PRIMITIVE_TYPE_ID(batch_norm);
58
59 #ifdef __cplusplus
60 }
61 #endif
62
63 /// @}
64 /// @}
65 /// @}
66 #endif /* BATCH_NORM_H */
67