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

neural_networks_training_partial_result.h
1 /* file: neural_networks_training_partial_result.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_PARTIAL_RESULT_H__
25 #define __NEURAL_NETWORKS_TRAINING_PARTIAL_RESULT_H__
26 
27 #include "algorithms/algorithm.h"
28 
29 #include "services/daal_defines.h"
30 #include "data_management/data/data_serialize.h"
31 #include "data_management/data/numeric_table.h"
32 #include "algorithms/neural_networks/neural_networks_training_model.h"
33 #include "algorithms/neural_networks/neural_networks_training_result.h"
34 
35 namespace daal
36 {
37 namespace algorithms
38 {
42 namespace neural_networks
43 {
44 namespace training
45 {
55 enum Step1LocalPartialResultId
56 {
57  derivatives,
58  batchSize,
59  lastStep1LocalPartialResultId = batchSize
60 };
61 
67 enum Step2MasterPartialResultId
68 {
69  resultFromMaster,
70  lastStep2MasterPartialResultId = resultFromMaster
71 };
72 
76 namespace interface1
77 {
84 class DAAL_EXPORT PartialResult : public daal::algorithms::PartialResult
85 {
86 public:
87  DECLARE_SERIALIZABLE_CAST(PartialResult);
88 
89  /*
90  * \DAAL_DEPRECATED
91  */
92  PartialResult();
93 
94  /*
95  * \DAAL_DEPRECATED
96  */
97  virtual ~PartialResult() {}
98 
105  data_management::NumericTablePtr DAAL_DEPRECATED get(Step1LocalPartialResultId id) const;
106 
113  void DAAL_DEPRECATED set(Step1LocalPartialResultId id, const data_management::NumericTablePtr &value);
114 
124  template<typename algorithmFPType>
125  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
126 
136  services::Status DAAL_DEPRECATED check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
137 
138 protected:
140  /*
141  * \DAAL_DEPRECATED
142  */
143  template<typename Archive, bool onDeserialize>
144  services::Status serialImpl(Archive *arch)
145  {
146  return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
147  }
148 };
149 
156 class DAAL_EXPORT DistributedPartialResult : public daal::algorithms::PartialResult
157 {
158 public:
159  DECLARE_SERIALIZABLE_CAST(DistributedPartialResult);
160 
161  /*
162  * \DAAL_DEPRECATED
163  */
164  DistributedPartialResult();
165 
172  training::ResultPtr get(Step2MasterPartialResultId id) const;
173 
180  DAAL_DEPRECATED void set(Step2MasterPartialResultId id, const training::ResultPtr &value);
181 
191  template<typename algorithmFPType>
192  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
193 
203  DAAL_DEPRECATED services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
204 
205 protected:
207  /*
208  * \DAAL_DEPRECATED
209  */
210  template<typename Archive, bool onDeserialize>
211  services::Status serialImpl(Archive *arch)
212  {
213  return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
214  }
215 };
216 
217 typedef services::SharedPtr<PartialResult> PartialResultPtr;
218 typedef services::SharedPtr<DistributedPartialResult> DistributedPartialResultPtr;
219 } // namespace interface1
220 
221 using interface1::PartialResult;
222 using interface1::PartialResultPtr;
223 using interface1::DistributedPartialResult;
224 using interface1::DistributedPartialResultPtr;
225 
227 }
228 }
229 }
230 } // namespace daal
231 #endif
daal::algorithms::neural_networks::training::Step1LocalPartialResultId
Step1LocalPartialResultId
Available identifiers of partial results of the neural network training algorithm required by the fir...
Definition: neural_networks_training_partial_result.h:55
daal_defines.h
daal::algorithms::neural_networks::training::Step2MasterPartialResultId
Step2MasterPartialResultId
Available identifiers of partial results of the neural network training algorithm equired by the seco...
Definition: neural_networks_training_partial_result.h:67
daal::algorithms::neural_networks::training::interface1::PartialResult
Provides methods to access partial result obtained with the compute() method of the neural network tr...
Definition: neural_networks_training_partial_result.h:84
daal::algorithms::neural_networks::training::interface1::DistributedPartialResult
Provides methods to access partial result obtained with the compute() method of the neural network tr...
Definition: neural_networks_training_partial_result.h:156
daal::algorithms::math::abs::value
Definition: abs_types.h:88

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