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

neural_networks_training_input.h
1 /* file: neural_networks_training_input.h */
2 /*******************************************************************************
3 * Copyright 2014-2020 Intel Corporation
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *******************************************************************************/
17 
18 /*
19 //++
20 // Implementation of neural network algorithm interface.
21 //--
22 */
23 
24 #ifndef __NEURAL_NETWORKS_TRAINING_INPUT_H__
25 #define __NEURAL_NETWORKS_TRAINING_INPUT_H__
26 
27 #include "algorithms/algorithm.h"
28 
29 #include "data_management/data/tensor.h"
30 #include "data_management/data/data_serialize.h"
31 #include "data_management/data/data_collection.h"
32 #include "services/daal_defines.h"
33 #include "algorithms/neural_networks/neural_networks_training_model.h"
34 #include "algorithms/neural_networks/neural_networks_training_partial_result.h"
35 
36 namespace daal
37 {
38 namespace algorithms
39 {
43 namespace neural_networks
44 {
45 namespace training
46 {
55 enum InputId
56 {
57  data,
58  groundTruth,
59  lastInputId = groundTruth
60 };
61 
66 enum InputCollectionId
67 {
68  groundTruthCollection = lastInputId + 1,
69  lastInputCollectionId = groundTruthCollection
70 };
71 
76 enum Step1LocalInputId
77 {
78  inputModel = lastInputCollectionId + 1,
79  lastStep1LocalInputId = inputModel
80 };
81 
86 enum Step2MasterInputId
87 {
88  partialResults,
90  lastStep2MasterInputId = partialResults
91 };
92 
96 namespace interface1
97 {
103 class DAAL_EXPORT Input : public daal::algorithms::Input
104 {
105 public:
109  Input(size_t nElements = lastInputCollectionId + 1);
113  Input(const Input& other);
114 
115  /*
116  * \DAAL_DEPRECATED
117  */
118  virtual ~Input() {}
119 
126  DAAL_DEPRECATED data_management::TensorPtr get(InputId id) const;
127 
134  DAAL_DEPRECATED data_management::KeyValueDataCollectionPtr get(InputCollectionId id) const;
135 
143  DAAL_DEPRECATED data_management::TensorPtr get(InputCollectionId id, size_t key) const;
144 
151  DAAL_DEPRECATED void set(InputId id, const data_management::TensorPtr &value);
152 
159  DAAL_DEPRECATED void set(InputCollectionId id, const data_management::KeyValueDataCollectionPtr &value);
160 
168  DAAL_DEPRECATED void add(InputCollectionId id, size_t key, const data_management::TensorPtr &value);
169 
178  services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
179 
180 protected:
181  /*
182  * \DAAL_DEPRECATED
183  */
184  DAAL_DEPRECATED services::Status checkImpl(const daal::algorithms::Parameter *par, int method) const;
185 };
186 
192 template<ComputeStep step>
193 class DAAL_EXPORT DistributedInput
194 {};
195 
201 template<>
202 class DAAL_EXPORT DistributedInput<step1Local> : public Input
203 {
204 public:
205  /*
206  * \DAAL_DEPRECATED
207  */
208  DistributedInput(size_t nElements = lastStep1LocalInputId + 1);
209  /*
210  * \DAAL_DEPRECATED
211  */
212  DistributedInput(const DistributedInput& other);
213 
214  /*
215  * \DAAL_DEPRECATED
216  */
217  virtual ~DistributedInput() {};
218 
219  using Input::set;
220  using Input::get;
221 
228  DAAL_DEPRECATED ModelPtr get(Step1LocalInputId id) const;
229 
236  DAAL_DEPRECATED void set(Step1LocalInputId id, const ModelPtr &value);
237 
246  DAAL_DEPRECATED services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
247 };
248 
254 template<>
255 class DAAL_EXPORT DistributedInput<step2Master> : public daal::algorithms::Input
256 {
257 public:
261  DistributedInput();
265  DistributedInput(const DistributedInput& other);
266 
267  virtual ~DistributedInput() {};
268 
275  DAAL_DEPRECATED data_management::KeyValueDataCollectionPtr get(Step2MasterInputId id) const;
276 
283  DAAL_DEPRECATED void set(Step2MasterInputId id, const data_management::KeyValueDataCollectionPtr &value);
284 
292  DAAL_DEPRECATED void add(Step2MasterInputId id, size_t key, const PartialResultPtr &value);
293 
302  DAAL_DEPRECATED services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
303 };
304 
305 } // namespace interface1
306 using interface1::Input;
307 using interface1::DistributedInput;
308 
310 }
311 }
312 }
313 } // namespace daal
314 #endif
daal::algorithms::neural_networks::training::Step2MasterInputId
Step2MasterInputId
Partial results from the previous steps in the distributed processing mode required by the second dis...
Definition: neural_networks_training_input.h:86
daal::step1Local
Definition: daal_defines.h:123
daal::algorithms::neural_networks::training::interface1::DistributedInput
Input objects of the neural network training algorithm in the distributed processing mode...
Definition: neural_networks_training_input.h:193
daal::algorithms::neural_networks::training::data
Definition: neural_networks_training_input.h:57
daal::algorithms::neural_networks::training::interface1::Input
Input objects of the neural network training algorithm.
Definition: neural_networks_training_input.h:103
daal::step2Master
Definition: daal_defines.h:124
daal::algorithms::neural_networks::training::interface1::Input::get
DAAL_DEPRECATED data_management::TensorPtr get(InputId id) const
daal_defines.h
daal::algorithms::neural_networks::training::InputCollectionId
InputCollectionId
Available identifiers of input collection objects for the neural network model based training...
Definition: neural_networks_training_input.h:66
daal::algorithms::neural_networks::training::groundTruth
Definition: neural_networks_training_input.h:58
daal::algorithms::neural_networks::training::InputId
InputId
Available identifiers of input objects for the neural network model based training.
Definition: neural_networks_training_input.h:55
daal::algorithms::neural_networks::training::interface1::Input::set
DAAL_DEPRECATED void set(InputId id, const data_management::TensorPtr &value)
daal::algorithms::neural_networks::training::partialResults
Definition: neural_networks_training_input.h:88
daal::algorithms::neural_networks::training::groundTruthCollection
Definition: neural_networks_training_input.h:68
daal::algorithms::neural_networks::training::inputModel
Definition: neural_networks_training_input.h:78
daal::algorithms::math::abs::value
Definition: abs_types.h:88
daal::algorithms::neural_networks::training::Step1LocalInputId
Step1LocalInputId
Available identifiers of input objects for the neural network model based training.
Definition: neural_networks_training_input.h:76

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