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

em_gmm_init_types.h
1 /* file: em_gmm_init_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 EM for GMM initialization interface.
45 //--
46 */
47 
48 #ifndef __EM_GMM_INIT_TYPES_H__
49 #define __EM_GMM_INIT_TYPES_H__
50 
51 #include "algorithms/algorithm.h"
52 #include "data_management/data/numeric_table.h"
53 #include "data_management/data/homogen_numeric_table.h"
54 #include "services/daal_defines.h"
55 #include "em_gmm_covariance_storage_id.h"
56 #include "algorithms/engines/mt19937/mt19937.h"
57 
58 namespace daal
59 {
60 namespace algorithms
61 {
62 namespace em_gmm
63 {
64 
77 namespace init
78 {
83 enum InputId
84 {
85  data,
86  lastInputId = data
87 };
88 
93 enum ResultId
94 {
95  weights,
96  means,
97  lastResultId = means
98 };
99 
104 enum ResultCovariancesId
105 {
106  covariances = lastResultId + 1,
107  lastResultCovariancesId = covariances
108 };
109 
114 enum Method
115 {
116  defaultDense = 0
117 };
118 
119 
123 namespace interface1
124 {
131 /* [Parameter source code] */
132 
133 struct DAAL_EXPORT Parameter : public daal::algorithms::Parameter
134 {
144  Parameter(size_t nComponents, size_t nTrials = 20, size_t nIterations = 10, size_t seed = 777,
145  double accuracyThreshold = 1.0e-04, em_gmm::CovarianceStorageId covarianceStorage = em_gmm::full);
146 
147  virtual ~Parameter() {}
148 
152  virtual services::Status check() const;
153 
154  size_t nComponents;
155  size_t nTrials;
156  size_t nIterations;
157  size_t seed;
158  double accuracyThreshold;
159  em_gmm::CovarianceStorageId covarianceStorage;
160  engines::EnginePtr engine;
161 };
162 /* [Parameter source code] */
163 
168 class DAAL_EXPORT Input : public daal::algorithms::Input
169 {
170 public:
172  Input();
173 
175  Input(const Input& other) : daal::algorithms::Input(other){}
176 
177  virtual ~Input() {}
178 
184  void set(InputId id, const data_management::NumericTablePtr &ptr);
185 
191  data_management::NumericTablePtr get(InputId id) const;
192 
198  services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
199 };
200 
205 class DAAL_EXPORT Result : public daal::algorithms::Result
206 {
207 public:
208  DECLARE_SERIALIZABLE_CAST(Result);
210  Result();
211 
212  virtual ~Result() {};
213 
220  template <typename algorithmFPType>
221  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
222 
228  void set(ResultId id, const data_management::NumericTablePtr &ptr);
229 
235  void set(ResultCovariancesId id, const data_management::DataCollectionPtr &ptr);
236 
242  data_management::NumericTablePtr get(ResultId id) const;
243 
249  data_management::DataCollectionPtr get(ResultCovariancesId id) const;
250 
257  data_management::NumericTablePtr get(ResultCovariancesId id, size_t index) const;
258 
265  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
266 
267 protected:
269  template<typename Archive, bool onDeserialize>
270  services::Status serialImpl(Archive *arch)
271  {
272  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
273  }
274 };
275 typedef services::SharedPtr<daal::algorithms::em_gmm::init::interface1::Result> ResultPtr;
278 } // namespace interface1
279 using interface1::Parameter;
280 using interface1::Input;
281 using interface1::Result;
282 using interface1::ResultPtr;
283 
284 } // namespace init
285 } // namespace em_gmm
286 } // namespace algorithm
287 } // namespace daal
288 #endif
daal::algorithms::em_gmm::init::interface1::Parameter::accuracyThreshold
double accuracyThreshold
Definition: em_gmm_init_types.h:158
daal::algorithms::em_gmm::init::interface1::Input
Input objects for the computation of initial values for the EM for GMM algorithm
Definition: em_gmm_init_types.h:168
daal::algorithms::em_gmm::init::ResultCovariancesId
ResultCovariancesId
Definition: em_gmm_init_types.h:104
daal
Definition: algorithm_base_common.h:57
daal::algorithms::em_gmm::CovarianceStorageId
CovarianceStorageId
Definition: em_gmm_covariance_storage_id.h:66
daal::algorithms::em_gmm::init::covariances
Definition: em_gmm_init_types.h:106
daal::algorithms::em_gmm::init::interface1::Parameter::seed
size_t seed
Definition: em_gmm_init_types.h:157
daal::algorithms::em_gmm::nIterations
Definition: em_gmm_types.h:123
daal::algorithms::em_gmm::init::interface1::Parameter::covarianceStorage
em_gmm::CovarianceStorageId covarianceStorage
Definition: em_gmm_init_types.h:159
daal_defines.h
daal::algorithms::em_gmm::init::Method
Method
Definition: em_gmm_init_types.h:114
daal::algorithms::em_gmm::init::interface1::Input::Input
Input(const Input &other)
Definition: em_gmm_init_types.h:175
daal::algorithms::em_gmm::init::data
Definition: em_gmm_init_types.h:85
daal::algorithms::em_gmm::init::interface1::Parameter::nTrials
size_t nTrials
Definition: em_gmm_init_types.h:155
daal::algorithms::em_gmm::init::ResultId
ResultId
Definition: em_gmm_init_types.h:93
daal::algorithms::em_gmm::init::interface1::Parameter::nIterations
size_t nIterations
Definition: em_gmm_init_types.h:156
daal::algorithms::em_gmm::init::interface1::Result
Results obtained with the compute() method of the initialization of the EM for GMM algorithm in the b...
Definition: em_gmm_init_types.h:205
daal::algorithms::em_gmm::init::interface1::Parameter::nComponents
size_t nComponents
Definition: em_gmm_init_types.h:154
daal::algorithms::em_gmm::init::defaultDense
Definition: em_gmm_init_types.h:116
daal::algorithms::em_gmm::init::means
Definition: em_gmm_init_types.h:96
daal::algorithms::em_gmm::init::interface1::Parameter::engine
engines::EnginePtr engine
Definition: em_gmm_init_types.h:160
daal::algorithms::em_gmm::init::InputId
InputId
Definition: em_gmm_init_types.h:83
daal::algorithms::em_gmm::init::interface1::Parameter
Parameter for the computation of initial values for the EM for GMM algorithm
Definition: em_gmm_init_types.h:133
daal::algorithms::em_gmm::init::weights
Definition: em_gmm_init_types.h:95

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