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

em_gmm_types.h
1 /* file: em_gmm_types.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 the EM for GMM algorithm interface.
21 //--
22 */
23 
24 #ifndef __EM_GMM_TYPES_H__
25 #define __EM_GMM_TYPES_H__
26 
27 #include "algorithms/algorithm.h"
28 #include "data_management/data/numeric_table.h"
29 #include "services/daal_defines.h"
30 #include "algorithms/covariance/covariance_batch.h"
31 #include "em_gmm_covariance_storage_id.h"
32 #include "em_gmm_init_types.h"
33 
34 namespace daal
35 {
36 namespace algorithms
37 {
47 namespace em_gmm
48 {
53 enum Method
54 {
55  defaultDense = 0
56 };
57 
62 enum InputId
63 {
64  data,
65  inputWeights,
66  inputMeans,
67  lastInputId = inputMeans
68 };
69 
74 enum InputCovariancesId
75 {
76  inputCovariances = lastInputId + 1,
77  lastInputCovariancesId = inputCovariances
78 };
79 
84 enum InputValuesId
85 {
86  inputValues = lastInputCovariancesId + 1,
87  lastInputValuesId = inputValues
88 };
89 
94 enum ResultId
95 {
96  weights,
97  means,
98  goalFunction,
99  nIterations,
100  lastResultId = nIterations
101 };
102 
107 enum ResultCovariancesId
108 {
109  covariances = lastResultId + 1,
110  lastResultCovariancesId = covariances
111 };
112 
116 namespace interface1
117 {
124 /* [Parameter source code] */
125 struct DAAL_EXPORT Parameter : public daal::algorithms::Parameter
126 {
136  Parameter(const size_t nComponents,
137  const services::SharedPtr<covariance::BatchImpl> &covariance,
138  const size_t maxIterations = 10,
139  const double accuracyThreshold = 1.0e-04,
140  const double regularizationFactor = 0.01,
141  const CovarianceStorageId covarianceStorage = full);
142 
143  Parameter(const Parameter &other);
144 
145  virtual ~Parameter() {}
146 
150  virtual services::Status check() const;
151 
152  size_t nComponents;
153  size_t maxIterations;
154  double accuracyThreshold;
155  services::SharedPtr<covariance::BatchImpl> covariance;
156  double regularizationFactor;
157  CovarianceStorageId covarianceStorage;
158 };
159 /* [Parameter source code] */
160 
165 class DAAL_EXPORT Input : public daal::algorithms::Input
166 {
167 public:
169  Input();
170 
172  Input(const Input& other) : daal::algorithms::Input(other){}
173 
174  virtual ~Input() {}
175 
181  void set(InputId id, const data_management::NumericTablePtr &ptr);
182 
188  void set(InputCovariancesId id, const data_management::DataCollectionPtr &ptr);
189 
195  void set(InputValuesId id, const init::ResultPtr &ptr);
196 
202  data_management::NumericTablePtr get(InputId id) const;
203 
209  data_management::DataCollectionPtr get(InputCovariancesId id) const;
210 
217  data_management::NumericTablePtr get(InputCovariancesId id, size_t index) const;
218 
219 
225  services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
226 };
227 
232 class DAAL_EXPORT Result: public daal::algorithms::Result
233 {
234 public:
235  DECLARE_SERIALIZABLE_CAST(Result);
237  Result();
238 
239  virtual ~Result() {};
240 
247  template <typename algorithmFPType>
248  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
249 
255  void set(ResultId id, const data_management::NumericTablePtr &ptr);
256 
262  void set(ResultCovariancesId id, const data_management::DataCollectionPtr &ptr);
263 
269  data_management::NumericTablePtr get(ResultId id) const;
270 
276  data_management::DataCollectionPtr get(ResultCovariancesId id) const;
277 
284  data_management::NumericTablePtr get(ResultCovariancesId id, size_t index) const;
285 
292  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
293 
294 protected:
296  template<typename Archive, bool onDeserialize>
297  services::Status serialImpl(Archive *arch)
298  {
299  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
300  }
301 };
302 typedef services::SharedPtr<Result> ResultPtr;
304 } // namespace interface1
305 using interface1::Parameter;
306 using interface1::Input;
307 using interface1::Result;
308 using interface1::ResultPtr;
309 
310 } // namespace em_gmm
311 } // namespace algorithm
312 } // namespace daal
313 #endif
daal::algorithms::em_gmm::inputCovariances
Definition: em_gmm_types.h:76
daal::algorithms::em_gmm::covariances
Definition: em_gmm_types.h:109
daal::algorithms::em_gmm::inputMeans
Definition: em_gmm_types.h:66
daal::algorithms::em_gmm::ResultCovariancesId
ResultCovariancesId
Definition: em_gmm_types.h:107
daal::algorithms::em_gmm::interface1::Input::Input
Input(const Input &other)
Definition: em_gmm_types.h:172
daal::algorithms::em_gmm::data
Definition: em_gmm_types.h:64
daal::algorithms::covariance::covariance
Definition: covariance_types.h:90
daal::algorithms::em_gmm::inputWeights
Definition: em_gmm_types.h:65
daal::algorithms::em_gmm::goalFunction
Definition: em_gmm_types.h:98
daal::algorithms::em_gmm::interface1::Parameter::covarianceStorage
CovarianceStorageId covarianceStorage
Definition: em_gmm_types.h:157
daal::algorithms::em_gmm::Method
Method
Definition: em_gmm_types.h:53
daal::algorithms::em_gmm::inputValues
Definition: em_gmm_types.h:86
daal::algorithms::em_gmm::CovarianceStorageId
CovarianceStorageId
Definition: em_gmm_covariance_storage_id.h:42
daal::algorithms::em_gmm::InputId
InputId
Definition: em_gmm_types.h:62
daal_defines.h
daal::algorithms::em_gmm::interface1::Parameter
Parameter for the EM for GMM algorithm
Definition: em_gmm_types.h:125
daal::algorithms::em_gmm::means
Definition: em_gmm_types.h:97
daal::algorithms::em_gmm::ResultId
ResultId
Definition: em_gmm_types.h:94
daal::algorithms::em_gmm::interface1::Parameter::covariance
services::SharedPtr< covariance::BatchImpl > covariance
Definition: em_gmm_types.h:155
daal::algorithms::em_gmm::defaultDense
Definition: em_gmm_types.h:55
daal::algorithms::em_gmm::weights
Definition: em_gmm_types.h:96
daal::algorithms::em_gmm::interface1::Parameter::accuracyThreshold
double accuracyThreshold
Definition: em_gmm_types.h:154
daal::algorithms::em_gmm::interface1::Parameter::nComponents
size_t nComponents
Definition: em_gmm_types.h:152
daal::algorithms::em_gmm::interface1::Parameter::maxIterations
size_t maxIterations
Definition: em_gmm_types.h:153
daal::algorithms::em_gmm::InputCovariancesId
InputCovariancesId
Definition: em_gmm_types.h:74
daal::algorithms::em_gmm::interface1::Parameter::regularizationFactor
double regularizationFactor
Definition: em_gmm_types.h:156
daal::algorithms::em_gmm::interface1::Result
Provides methods to access final results obtained with the compute() method of the EM for GMM algorit...
Definition: em_gmm_types.h:232
daal::algorithms::em_gmm::InputValuesId
InputValuesId
Definition: em_gmm_types.h:84
daal::algorithms::em_gmm::nIterations
Definition: em_gmm_types.h:99
daal::algorithms::em_gmm::interface1::Input
Input objects for the EM for GMM algorithm
Definition: em_gmm_types.h:165

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