C++ API Reference for Intel® Data Analytics Acceleration Library 2019 Update 4

batch_normalization_layer_forward_types.h
1 /* file: batch_normalization_layer_forward_types.h */
2 /*******************************************************************************
3 * Copyright 2014-2019 Intel Corporation.
4 *
5 * This software and the related documents are Intel copyrighted materials, and
6 * your use of them is governed by the express license under which they were
7 * provided to you (License). Unless the License provides otherwise, you may not
8 * use, modify, copy, publish, distribute, disclose or transmit this software or
9 * the related documents without Intel's prior written permission.
10 *
11 * This software and the related documents are provided as is, with no express
12 * or implied warranties, other than those that are expressly stated in the
13 * License.
14 *******************************************************************************/
15 
16 /*
17 //++
18 // Implementation of the forward batch normalization layer.
19 //--
20 */
21 
22 #ifndef __BATCH_NORMALIZATION_LAYER_FORWARD_TYPES_H__
23 #define __BATCH_NORMALIZATION_LAYER_FORWARD_TYPES_H__
24 
25 #include "algorithms/algorithm.h"
26 #include "data_management/data/tensor.h"
27 #include "data_management/data/homogen_tensor.h"
28 #include "services/daal_defines.h"
29 #include "algorithms/neural_networks/layers/layer_forward_types.h"
30 #include "algorithms/neural_networks/layers/batch_normalization/batch_normalization_layer_types.h"
31 
32 namespace daal
33 {
34 namespace algorithms
35 {
36 namespace neural_networks
37 {
38 namespace layers
39 {
40 namespace batch_normalization
41 {
51 namespace forward
52 {
57 enum InputLayerDataId
58 {
59  populationMean = layers::forward::lastInputLayerDataId + 1,
60  populationVariance,
61  lastInputLayerDataId = populationVariance
62 };
63 
67 namespace interface1
68 {
73 class DAAL_EXPORT Input : public layers::forward::Input
74 {
75 public:
76  typedef layers::forward::Input super;
78  Input();
79 
81  Input(const Input& other);
82 
83  virtual ~Input() {}
84 
88  using layers::forward::Input::get;
92  using layers::forward::Input::set;
93 
94 
102  template <typename algorithmFPType>
103  DAAL_EXPORT services::Status allocate(const daal::algorithms::Parameter *parameter, const int method);
104 
109  virtual const services::Collection<size_t> getWeightsSizes(const layers::Parameter *parameter) const DAAL_C11_OVERRIDE;
110 
115  virtual const services::Collection<size_t> getBiasesSizes(const layers::Parameter *parameter) const DAAL_C11_OVERRIDE;
116 
122  data_management::TensorPtr get(InputLayerDataId id) const;
123 
129  void set(InputLayerDataId id, const data_management::TensorPtr &ptr);
130 
138  services::Status check(const daal::algorithms::Parameter *parameter, int method) const DAAL_C11_OVERRIDE;
139 };
140 
146 class DAAL_EXPORT Result : public layers::forward::Result
147 {
148 public:
149  DECLARE_SERIALIZABLE_CAST(Result);
151  Result();
152  virtual ~Result() {}
153 
154  using layers::forward::Result::get;
155  using layers::forward::Result::set;
156 
161  virtual const services::Collection<size_t> getValueSize(const services::Collection<size_t> &inputSize,
162  const daal::algorithms::Parameter *par, const int method) const DAAL_C11_OVERRIDE;
163 
172  template <typename algorithmFPType>
173  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
174 
181  virtual services::Status setResultForBackward(const daal::algorithms::Input *input) DAAL_C11_OVERRIDE;
182 
188  data_management::TensorPtr get(LayerDataId id) const;
189 
195  void set(LayerDataId id, const data_management::TensorPtr &ptr);
196 
205  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, int method) const DAAL_C11_OVERRIDE;
206 
207 protected:
209  template<typename Archive, bool onDeserialize>
210  services::Status serialImpl(Archive *arch)
211  {
212  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
213  }
214 };
215 typedef services::SharedPtr<Result> ResultPtr;
216 
217 } // namespace interface1
218 using interface1::Input;
219 using interface1::Result;
220 using interface1::ResultPtr;
221 
222 } // namespace forward
223 
225 } // namespace batch_normalization
226 } // namespace layers
227 } // namespace neural_networks
228 } // namespace algorithm
229 } // namespace daal
230 
231 #endif
daal::algorithms::neural_networks::layers::batch_normalization::forward::populationMean
Definition: batch_normalization_layer_forward_types.h:59
daal::algorithms::neural_networks::layers::batch_normalization::forward::interface1::Result
Provides methods to access the result obtained with the compute() method of the forward batch normali...
Definition: batch_normalization_layer_forward_types.h:146
daal::algorithms::neural_networks::layers::batch_normalization::LayerDataId
LayerDataId
Identifiers of input objects for the backward batch normalization layer and results for the forward b...
Definition: batch_normalization_layer_types.h:60
daal
Definition: algorithm_base_common.h:31
daal::algorithms::neural_networks::layers::batch_normalization::forward::interface1::Input
Input objects for the forward batch normalization layer.
Definition: batch_normalization_layer_forward_types.h:73
daal_defines.h
daal::algorithms::neural_networks::layers::batch_normalization::forward::InputLayerDataId
InputLayerDataId
Definition: batch_normalization_layer_forward_types.h:57
daal::algorithms::neural_networks::layers::batch_normalization::forward::populationVariance
Definition: batch_normalization_layer_forward_types.h:60

For more complete information about compiler optimizations, see our Optimization Notice.