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

lbfgs_types.h
1 /* file: lbfgs_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 limited memory Broyden-Fletcher-Goldfarb-Shanno
19 // algorithm types.
20 //--
21 */
22 #ifndef __LBFGS_TYPES_H__
23 #define __LBFGS_TYPES_H__
24 
25 #include "algorithms/algorithm.h"
26 #include "data_management/data/numeric_table.h"
27 #include "data_management/data/homogen_numeric_table.h"
28 #include "data_management/data/memory_block.h"
29 #include "services/daal_defines.h"
30 #include "algorithms/optimization_solver/iterative_solver/iterative_solver_batch.h"
31 #include "algorithms/optimization_solver/objective_function/sum_of_functions_batch.h"
32 #include "algorithms/engines/mt19937/mt19937.h"
33 
34 namespace daal
35 {
36 namespace algorithms
37 {
46 namespace optimization_solver
47 {
57 namespace lbfgs
58 {
59 
65 enum Method
66 {
67  defaultDense = 0
68 };
69 
74 enum OptionalDataId
75 {
76  correctionPairs = iterative_solver::lastOptionalData + 1,
79  correctionIndices,
82  averageArgumentLIterations,
86  lastOptionalData = averageArgumentLIterations,
87 };
88 
92 namespace interface1
93 {
94 
101 /* [Parameter source code] */
102 struct DAAL_EXPORT Parameter : public optimization_solver::iterative_solver::Parameter
103 {
115  Parameter(sum_of_functions::BatchPtr function = sum_of_functions::BatchPtr(),
116  size_t nIterations = 100, double accuracyThreshold = 1.0e-5,
117  size_t batchSize = 10, size_t correctionPairBatchSize_ = 100,
118  size_t m = 10, size_t L = 10, size_t seed = 777);
119 
120  virtual ~Parameter() {}
121 
122  size_t m;
125  size_t L;
126  size_t seed;
127  engines::EnginePtr engine;
129  data_management::NumericTablePtr batchIndices;
130 
131  size_t correctionPairBatchSize;
134  data_management::NumericTablePtr correctionPairBatchIndices;
138  data_management::NumericTablePtr stepLengthSequence;
139 
145  virtual services::Status check() const DAAL_C11_OVERRIDE;
146 };
147 /* [Parameter source code] */
148 
155 /* [Input source code] */
156 class DAAL_EXPORT Input : public optimization_solver::iterative_solver::Input
157 {
158 public:
159  typedef optimization_solver::iterative_solver::Input super;
160  Input();
161  Input(const Input& other);
162  using super::set;
163  using super::get;
164 
170  data_management::NumericTablePtr get(OptionalDataId id) const;
171 
177  void set(OptionalDataId id, const data_management::NumericTablePtr &ptr);
178 
186  virtual services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
187 };
188 /* [Input source code] */
189 
194 class DAAL_EXPORT Result : public optimization_solver::iterative_solver::Result
195 {
196 public:
197  DECLARE_SERIALIZABLE_CAST(Result);
198  typedef optimization_solver::iterative_solver::Result super;
199 
200  Result() {}
201  using super::set;
202  using super::get;
203 
210  template <typename algorithmFPType>
211  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, const int method);
212 
218  data_management::NumericTablePtr get(OptionalDataId id) const;
219 
225  void set(OptionalDataId id, const data_management::NumericTablePtr &ptr);
226 
235  virtual services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par,
236  int method) const DAAL_C11_OVERRIDE;
237 };
238 typedef services::SharedPtr<Result> ResultPtr;
239 /* [Result source code] */
240 
242 } // namespace interface1
243 using interface1::Parameter;
244 using interface1::Input;
245 using interface1::Result;
246 using interface1::ResultPtr;
247 
248 } // namespace lbfgs
249 } // namespace optimization_solver
250 } // namespace algorithm
251 } // namespace daal
252 #endif
daal
Definition: algorithm_base_common.h:31
daal::algorithms::optimization_solver::lbfgs::OptionalDataId
OptionalDataId
Definition: lbfgs_types.h:74
daal::algorithms::optimization_solver::lbfgs::interface1::Input
Input class for LBFGS algorithm
Definition: lbfgs_types.h:156
daal::algorithms::em_gmm::nIterations
Definition: em_gmm_types.h:97
daal::algorithms::optimization_solver::lbfgs::interface1::Parameter::L
size_t L
Definition: lbfgs_types.h:125
daal::algorithms::optimization_solver::lbfgs::interface1::Parameter::m
size_t m
Definition: lbfgs_types.h:122
daal::algorithms::optimization_solver::lbfgs::correctionIndices
Definition: lbfgs_types.h:79
daal_defines.h
daal::algorithms::optimization_solver::lbfgs::defaultDense
Definition: lbfgs_types.h:67
daal::algorithms::optimization_solver::lbfgs::Method
Method
Definition: lbfgs_types.h:65
daal::algorithms::optimization_solver::lbfgs::interface1::Parameter::stepLengthSequence
data_management::NumericTablePtr stepLengthSequence
Definition: lbfgs_types.h:138
daal::algorithms::optimization_solver::lbfgs::interface1::Result
Results obtained with the compute() method of the LBFGS algorithm in the batch processing mode...
Definition: lbfgs_types.h:194
daal::algorithms::optimization_solver::lbfgs::averageArgumentLIterations
Definition: lbfgs_types.h:82
daal::algorithms::optimization_solver::lbfgs::interface1::Parameter::seed
size_t seed
Definition: lbfgs_types.h:126
daal::algorithms::optimization_solver::lbfgs::correctionPairs
Definition: lbfgs_types.h:76
daal::algorithms::optimization_solver::lbfgs::interface1::Parameter::engine
engines::EnginePtr engine
Definition: lbfgs_types.h:127
daal::algorithms::optimization_solver::lbfgs::interface1::Parameter
Parameter class for LBFGS algorithm
Definition: lbfgs_types.h:102
daal::algorithms::optimization_solver::lbfgs::interface1::Parameter::correctionPairBatchIndices
data_management::NumericTablePtr correctionPairBatchIndices
Definition: lbfgs_types.h:134
daal::algorithms::optimization_solver::lbfgs::interface1::Parameter::correctionPairBatchSize
size_t correctionPairBatchSize
Definition: lbfgs_types.h:131

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