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

neural_networks_training_partial_result.h
1 /* file: neural_networks_training_partial_result.h */
2 /*******************************************************************************
3 * Copyright 2014-2018 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 neural network algorithm interface.
45 //--
46 */
47 
48 #ifndef __NEURAL_NETWORKS_TRAINING_PARTIAL_RESULT_H__
49 #define __NEURAL_NETWORKS_TRAINING_PARTIAL_RESULT_H__
50 
51 #include "algorithms/algorithm.h"
52 
53 #include "services/daal_defines.h"
54 #include "data_management/data/data_serialize.h"
55 #include "data_management/data/numeric_table.h"
56 #include "algorithms/neural_networks/neural_networks_training_model.h"
57 #include "algorithms/neural_networks/neural_networks_training_result.h"
58 
59 namespace daal
60 {
61 namespace algorithms
62 {
66 namespace neural_networks
67 {
68 namespace training
69 {
79 enum Step1LocalPartialResultId
80 {
81  derivatives,
82  batchSize,
83  lastStep1LocalPartialResultId = batchSize
84 };
85 
91 enum Step2MasterPartialResultId
92 {
93  resultFromMaster,
94  lastStep2MasterPartialResultId = resultFromMaster
95 };
96 
100 namespace interface1
101 {
107 class DAAL_EXPORT PartialResult : public daal::algorithms::PartialResult
108 {
109 public:
110  DECLARE_SERIALIZABLE_CAST(PartialResult);
111 
112  PartialResult();
113 
114  virtual ~PartialResult() {}
115 
121  data_management::NumericTablePtr get(Step1LocalPartialResultId id) const;
122 
128  void set(Step1LocalPartialResultId id, const data_management::NumericTablePtr &value);
129 
138  template<typename algorithmFPType>
139  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
140 
149  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
150 
151 protected:
153  template<typename Archive, bool onDeserialize>
154  services::Status serialImpl(Archive *arch)
155  {
156  return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
157  }
158 };
159 
165 class DAAL_EXPORT DistributedPartialResult : public daal::algorithms::PartialResult
166 {
167 public:
168  DECLARE_SERIALIZABLE_CAST(DistributedPartialResult);
169 
170  DistributedPartialResult();
171 
177  training::ResultPtr get(Step2MasterPartialResultId id) const;
178 
184  void set(Step2MasterPartialResultId id, const training::ResultPtr &value);
185 
194  template<typename algorithmFPType>
195  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
196 
205  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, 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::PartialResult::serialImpl<Archive, onDeserialize>(arch);
213  }
214 };
215 
216 typedef services::SharedPtr<PartialResult> PartialResultPtr;
217 typedef services::SharedPtr<DistributedPartialResult> DistributedPartialResultPtr;
218 } // namespace interface1
219 
220 using interface1::PartialResult;
221 using interface1::PartialResultPtr;
222 using interface1::DistributedPartialResult;
223 using interface1::DistributedPartialResultPtr;
224 
226 }
227 }
228 }
229 } // namespace daal
230 #endif
daal::services::interface1::Status
Class that holds the results of API calls. In case of API routine failure it contains the list of err...
Definition: error_handling.h:491
daal
Definition: algorithm_base_common.h:57
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:91
daal::algorithms::interface1::PartialResult
Base class to represent partial results of the computation. Algorithm-specific partial results are re...
Definition: algorithm_types.h:253
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:79
daal::algorithms::interface1::Parameter
Base class to represent computation parameters. Algorithm-specific parameters are represented as deri...
Definition: algorithm_types.h:86
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:165
daal::services::interface1::SharedPtr
Shared pointer that retains shared ownership of an object through a pointer. Several SharedPtr object...
Definition: daal_shared_ptr.h:187
daal::algorithms::math::abs::value
Definition: abs_types.h:112
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:107
daal::algorithms::interface1::Input
Base class to represent computation input arguments. Algorithm-specific input arguments are represent...
Definition: algorithm_types.h:217

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