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

neural_networks_training_partial_result.h
1 /* file: neural_networks_training_partial_result.h */
2 /*******************************************************************************
3 * Copyright 2014-2018 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 neural network algorithm interface.
19 //--
20 */
21 
22 #ifndef __NEURAL_NETWORKS_TRAINING_PARTIAL_RESULT_H__
23 #define __NEURAL_NETWORKS_TRAINING_PARTIAL_RESULT_H__
24 
25 #include "algorithms/algorithm.h"
26 
27 #include "services/daal_defines.h"
28 #include "data_management/data/data_serialize.h"
29 #include "data_management/data/numeric_table.h"
30 #include "algorithms/neural_networks/neural_networks_training_model.h"
31 #include "algorithms/neural_networks/neural_networks_training_result.h"
32 
33 namespace daal
34 {
35 namespace algorithms
36 {
40 namespace neural_networks
41 {
42 namespace training
43 {
53 enum Step1LocalPartialResultId
54 {
55  derivatives,
56  batchSize,
57  lastStep1LocalPartialResultId = batchSize
58 };
59 
65 enum Step2MasterPartialResultId
66 {
67  resultFromMaster,
68  lastStep2MasterPartialResultId = resultFromMaster
69 };
70 
74 namespace interface1
75 {
81 class DAAL_EXPORT PartialResult : public daal::algorithms::PartialResult
82 {
83 public:
84  DECLARE_SERIALIZABLE_CAST(PartialResult);
85 
86  PartialResult();
87 
88  virtual ~PartialResult() {}
89 
95  data_management::NumericTablePtr get(Step1LocalPartialResultId id) const;
96 
102  void set(Step1LocalPartialResultId id, const data_management::NumericTablePtr &value);
103 
112  template<typename algorithmFPType>
113  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
114 
123  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
124 
125 protected:
127  template<typename Archive, bool onDeserialize>
128  services::Status serialImpl(Archive *arch)
129  {
130  return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
131  }
132 };
133 
139 class DAAL_EXPORT DistributedPartialResult : public daal::algorithms::PartialResult
140 {
141 public:
142  DECLARE_SERIALIZABLE_CAST(DistributedPartialResult);
143 
144  DistributedPartialResult();
145 
151  training::ResultPtr get(Step2MasterPartialResultId id) const;
152 
158  void set(Step2MasterPartialResultId id, const training::ResultPtr &value);
159 
168  template<typename algorithmFPType>
169  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
170 
179  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
180 
181 protected:
183  template<typename Archive, bool onDeserialize>
184  services::Status serialImpl(Archive *arch)
185  {
186  return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
187  }
188 };
189 
190 typedef services::SharedPtr<PartialResult> PartialResultPtr;
191 typedef services::SharedPtr<DistributedPartialResult> DistributedPartialResultPtr;
192 } // namespace interface1
193 
194 using interface1::PartialResult;
195 using interface1::PartialResultPtr;
196 using interface1::DistributedPartialResult;
197 using interface1::DistributedPartialResultPtr;
198 
200 }
201 }
202 }
203 } // namespace daal
204 #endif
daal
Definition: algorithm_base_common.h:31
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:65
daal_defines.h
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:53
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:139
daal::algorithms::math::abs::value
Definition: abs_types.h:86
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:81

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