C++ API Reference for Intel® Data Analytics Acceleration Library 2018 Update 1

split_layer_backward_types.h
1 /* file: split_layer_backward_types.h */
2 /*******************************************************************************
3 * Copyright 2014-2017 Intel Corporation
4 * All Rights Reserved.
5 *
6 * If this software was obtained under the Intel Simplified Software License,
7 * the following terms apply:
8 *
9 * The source code, information and material ("Material") contained herein is
10 * owned by Intel Corporation or its suppliers or licensors, and title to such
11 * Material remains with Intel Corporation or its suppliers or licensors. The
12 * Material contains proprietary information of Intel or its suppliers and
13 * licensors. The Material is protected by worldwide copyright laws and treaty
14 * provisions. No part of the Material may be used, copied, reproduced,
15 * modified, published, uploaded, posted, transmitted, distributed or disclosed
16 * in any way without Intel's prior express written permission. No license under
17 * any patent, copyright or other intellectual property rights in the Material
18 * is granted to or conferred upon you, either expressly, by implication,
19 * inducement, estoppel or otherwise. Any license under such intellectual
20 * property rights must be express and approved by Intel in writing.
21 *
22 * Unless otherwise agreed by Intel in writing, you may not remove or alter this
23 * notice or any other notice embedded in Materials by Intel or Intel's
24 * suppliers or licensors in any way.
25 *
26 *
27 * If this software was obtained under the Apache License, Version 2.0 (the
28 * "License"), the following terms apply:
29 *
30 * You may not use this file except in compliance with the License. You may
31 * obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
32 *
33 *
34 * Unless required by applicable law or agreed to in writing, software
35 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
36 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37 *
38 * See the License for the specific language governing permissions and
39 * limitations under the License.
40 *******************************************************************************/
41 
42 /*
43 //++
44 // Implementation of the backward split layer
45 //--
46 */
47 
48 #ifndef __SPLIT_LAYER_BACKWARD_TYPES_H__
49 #define __SPLIT_LAYER_BACKWARD_TYPES_H__
50 
51 #include "algorithms/algorithm.h"
52 #include "data_management/data/tensor.h"
53 #include "data_management/data/homogen_tensor.h"
54 #include "services/daal_defines.h"
55 #include "algorithms/neural_networks/layers/layer_backward_types.h"
56 #include "algorithms/neural_networks/layers/split/split_layer_types.h"
57 
58 namespace daal
59 {
60 namespace algorithms
61 {
62 namespace neural_networks
63 {
64 namespace layers
65 {
69 namespace split
70 {
80 namespace backward
81 {
86 enum InputLayerDataId
87 {
88  inputGradientCollection = 1
89 };
90 
94 namespace interface1
95 {
96 
101 class DAAL_EXPORT Input : public layers::backward::Input
102 {
103 public:
105  Input();
106 
107  virtual ~Input() {}
108 
112  using layers::backward::Input::get;
113 
117  using layers::backward::Input::set;
118 
125  data_management::TensorPtr get(InputLayerDataId id, size_t index) const;
126 
132  LayerDataPtr get(InputLayerDataId id) const;
133 
140  void set(InputLayerDataId id, const data_management::TensorPtr &value, size_t index);
141 
147  void set(InputLayerDataId id, const LayerDataPtr &ptr);
148 
156  virtual services::Status addInputGradient(const data_management::TensorPtr &igTensor, size_t index) DAAL_C11_OVERRIDE;
157 
162  virtual services::Status setInputFromForward(layers::forward::ResultPtr result) DAAL_C11_OVERRIDE;
163 
171  services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
172 
177  virtual LayerInputLayout getLayout() const DAAL_C11_OVERRIDE;
178 };
179 
184 class DAAL_EXPORT Result : public layers::backward::Result
185 {
186 public:
187  DECLARE_SERIALIZABLE_CAST(Result);
189  Result();
190  virtual ~Result() {};
191 
195  using layers::backward::Result::get;
196 
200  using layers::backward::Result::set;
201 
210  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
211 
220  template <typename algorithmFPType>
221  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
222 
223 protected:
225  template<typename Archive, bool onDeserialize>
226  services::Status serialImpl(Archive *arch)
227  {
228  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
229  }
230 };
231 typedef services::SharedPtr<Result> ResultPtr;
232 
233 } // namespace interface1
234 using interface1::Input;
235 using interface1::Result;
236 using interface1::ResultPtr;
237 } // namespace backward
239 } // namespace split
240 } // namespace layers
241 } // namespace neural_networks
242 } // namespace algorithm
243 } // namespace daal
244 #endif
daal::algorithms::neural_networks::layers::split::backward::inputGradientCollection
Definition: split_layer_backward_types.h:88
daal
Definition: algorithm_base_common.h:57
daal_defines.h
daal::algorithms::neural_networks::layers::split::backward::interface1::Result
Provides methods to access the result obtained with the compute() method of the backward split layer...
Definition: split_layer_backward_types.h:184
daal::algorithms::neural_networks::layers::LayerInputLayout
LayerInputLayout
Definition: layer_types.h:83
daal::algorithms::neural_networks::layers::split::backward::InputLayerDataId
InputLayerDataId
Definition: split_layer_backward_types.h:86
daal::algorithms::math::abs::value
Definition: abs_types.h:112
daal::algorithms::neural_networks::layers::split::backward::interface1::Input
Input parameters for the backward split layer
Definition: split_layer_backward_types.h:101

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