C++ API Reference for Intel® Data Analytics Acceleration Library 2019

em_gmm_types.h
1 /* file: em_gmm_types.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 the EM for GMM algorithm interface.
19 //--
20 */
21 
22 #ifndef __EM_GMM_TYPES_H__
23 #define __EM_GMM_TYPES_H__
24 
25 #include "algorithms/algorithm.h"
26 #include "data_management/data/numeric_table.h"
27 #include "services/daal_defines.h"
28 #include "algorithms/covariance/covariance_batch.h"
29 #include "em_gmm_covariance_storage_id.h"
30 #include "em_gmm_init_types.h"
31 
32 namespace daal
33 {
34 namespace algorithms
35 {
45 namespace em_gmm
46 {
51 enum Method
52 {
53  defaultDense = 0
54 };
55 
60 enum InputId
61 {
62  data,
63  inputWeights,
64  inputMeans,
65  lastInputId = inputMeans
66 };
67 
72 enum InputCovariancesId
73 {
74  inputCovariances = lastInputId + 1,
75  lastInputCovariancesId = inputCovariances
76 };
77 
82 enum InputValuesId
83 {
84  inputValues = lastInputCovariancesId + 1,
85  lastInputValuesId = inputValues
86 };
87 
92 enum ResultId
93 {
94  weights,
95  means,
96  goalFunction,
97  nIterations,
98  lastResultId = nIterations
99 };
100 
105 enum ResultCovariancesId
106 {
107  covariances = lastResultId + 1,
108  lastResultCovariancesId = covariances
109 };
110 
114 namespace interface1
115 {
122 /* [Parameter source code] */
123 struct DAAL_EXPORT Parameter : public daal::algorithms::Parameter
124 {
134  Parameter(const size_t nComponents,
135  const services::SharedPtr<covariance::BatchImpl> &covariance,
136  const size_t maxIterations = 10,
137  const double accuracyThreshold = 1.0e-04,
138  const double regularizationFactor = 0.01,
139  const CovarianceStorageId covarianceStorage = full);
140 
141  Parameter(const Parameter &other);
142 
143  virtual ~Parameter() {}
144 
148  virtual services::Status check() const;
149 
150  size_t nComponents;
151  size_t maxIterations;
152  double accuracyThreshold;
153  services::SharedPtr<covariance::BatchImpl> covariance;
154  double regularizationFactor;
155  CovarianceStorageId covarianceStorage;
156 };
157 /* [Parameter source code] */
158 
163 class DAAL_EXPORT Input : public daal::algorithms::Input
164 {
165 public:
167  Input();
168 
170  Input(const Input& other) : daal::algorithms::Input(other){}
171 
172  virtual ~Input() {}
173 
179  void set(InputId id, const data_management::NumericTablePtr &ptr);
180 
186  void set(InputCovariancesId id, const data_management::DataCollectionPtr &ptr);
187 
193  void set(InputValuesId id, const init::ResultPtr &ptr);
194 
200  data_management::NumericTablePtr get(InputId id) const;
201 
207  data_management::DataCollectionPtr get(InputCovariancesId id) const;
208 
215  data_management::NumericTablePtr get(InputCovariancesId id, size_t index) const;
216 
217 
223  services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
224 };
225 
230 class DAAL_EXPORT Result: public daal::algorithms::Result
231 {
232 public:
233  DECLARE_SERIALIZABLE_CAST(Result);
235  Result();
236 
237  virtual ~Result() {};
238 
245  template <typename algorithmFPType>
246  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *parameter, const int method);
247 
253  void set(ResultId id, const data_management::NumericTablePtr &ptr);
254 
260  void set(ResultCovariancesId id, const data_management::DataCollectionPtr &ptr);
261 
267  data_management::NumericTablePtr get(ResultId id) const;
268 
274  data_management::DataCollectionPtr get(ResultCovariancesId id) const;
275 
282  data_management::NumericTablePtr get(ResultCovariancesId id, size_t index) const;
283 
290  services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
291 
292 protected:
294  template<typename Archive, bool onDeserialize>
295  services::Status serialImpl(Archive *arch)
296  {
297  return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
298  }
299 };
300 typedef services::SharedPtr<Result> ResultPtr;
302 } // namespace interface1
303 using interface1::Parameter;
304 using interface1::Input;
305 using interface1::Result;
306 using interface1::ResultPtr;
307 
308 } // namespace em_gmm
309 } // namespace algorithm
310 } // namespace daal
311 #endif
daal::algorithms::em_gmm::defaultDense
Definition: em_gmm_types.h:53
daal::algorithms::em_gmm::Method
Method
Definition: em_gmm_types.h:51
daal::algorithms::em_gmm::interface1::Input
Input objects for the EM for GMM algorithm
Definition: em_gmm_types.h:163
daal::algorithms::em_gmm::goalFunction
Definition: em_gmm_types.h:96
daal
Definition: algorithm_base_common.h:31
daal::algorithms::em_gmm::interface1::Input::Input
Input(const Input &other)
Definition: em_gmm_types.h:170
daal::algorithms::em_gmm::CovarianceStorageId
CovarianceStorageId
Definition: em_gmm_covariance_storage_id.h:40
daal::algorithms::em_gmm::InputId
InputId
Definition: em_gmm_types.h:60
daal::algorithms::em_gmm::inputValues
Definition: em_gmm_types.h:84
daal::algorithms::em_gmm::nIterations
Definition: em_gmm_types.h:97
daal::algorithms::em_gmm::inputWeights
Definition: em_gmm_types.h:63
daal::algorithms::em_gmm::data
Definition: em_gmm_types.h:62
daal::algorithms::em_gmm::covariances
Definition: em_gmm_types.h:107
daal_defines.h
daal::algorithms::em_gmm::interface1::Parameter::nComponents
size_t nComponents
Definition: em_gmm_types.h:150
daal::algorithms::em_gmm::means
Definition: em_gmm_types.h:95
daal::algorithms::em_gmm::weights
Definition: em_gmm_types.h:94
daal::algorithms::em_gmm::ResultCovariancesId
ResultCovariancesId
Definition: em_gmm_types.h:105
daal::algorithms::covariance::covariance
Definition: covariance_types.h:88
daal::algorithms::em_gmm::inputCovariances
Definition: em_gmm_types.h:74
daal::algorithms::em_gmm::interface1::Parameter::regularizationFactor
double regularizationFactor
Definition: em_gmm_types.h:154
daal::algorithms::em_gmm::interface1::Parameter::covariance
services::SharedPtr< covariance::BatchImpl > covariance
Definition: em_gmm_types.h:153
daal::algorithms::em_gmm::InputValuesId
InputValuesId
Definition: em_gmm_types.h:82
daal::algorithms::em_gmm::ResultId
ResultId
Definition: em_gmm_types.h:92
daal::algorithms::em_gmm::inputMeans
Definition: em_gmm_types.h:64
daal::algorithms::em_gmm::interface1::Parameter
Parameter for the EM for GMM algorithm
Definition: em_gmm_types.h:123
daal::algorithms::em_gmm::interface1::Parameter::covarianceStorage
CovarianceStorageId covarianceStorage
Definition: em_gmm_types.h:155
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:230
daal::algorithms::em_gmm::InputCovariancesId
InputCovariancesId
Definition: em_gmm_types.h:72
daal::algorithms::em_gmm::interface1::Parameter::accuracyThreshold
double accuracyThreshold
Definition: em_gmm_types.h:152
daal::algorithms::em_gmm::interface1::Parameter::maxIterations
size_t maxIterations
Definition: em_gmm_types.h:151

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