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

lbfgs_types.h
1 /* file: lbfgs_types.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 limited memory Broyden-Fletcher-Goldfarb-Shanno
45 // algorithm types.
46 //--
47 */
48 #ifndef __LBFGS_TYPES_H__
49 #define __LBFGS_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 "data_management/data/memory_block.h"
55 #include "services/daal_defines.h"
56 #include "algorithms/optimization_solver/iterative_solver/iterative_solver_batch.h"
57 #include "algorithms/optimization_solver/objective_function/sum_of_functions_batch.h"
58 #include "algorithms/engines/mt19937/mt19937.h"
59 
60 namespace daal
61 {
62 namespace algorithms
63 {
72 namespace optimization_solver
73 {
83 namespace lbfgs
84 {
85 
91 enum Method
92 {
93  defaultDense = 0
94 };
95 
100 enum OptionalDataId
101 {
102  correctionPairs = iterative_solver::lastOptionalData + 1,
105  correctionIndices,
108  averageArgumentLIterations,
112  lastOptionalData = averageArgumentLIterations,
113 };
114 
118 namespace interface1
119 {
120 
127 /* [Parameter source code] */
128 struct DAAL_EXPORT Parameter : public optimization_solver::iterative_solver::Parameter
129 {
141  Parameter(sum_of_functions::BatchPtr function = sum_of_functions::BatchPtr(),
142  size_t nIterations = 100, double accuracyThreshold = 1.0e-5,
143  size_t batchSize = 10, size_t correctionPairBatchSize_ = 100,
144  size_t m = 10, size_t L = 10, size_t seed = 777);
145 
146  virtual ~Parameter() {}
147 
148  size_t m;
151  size_t L;
152  size_t seed;
153  engines::EnginePtr engine;
155  data_management::NumericTablePtr batchIndices;
156 
157  size_t correctionPairBatchSize;
160  data_management::NumericTablePtr correctionPairBatchIndices;
164  data_management::NumericTablePtr stepLengthSequence;
165 
171  virtual services::Status check() const DAAL_C11_OVERRIDE;
172 };
173 /* [Parameter source code] */
174 
181 /* [Input source code] */
182 class DAAL_EXPORT Input : public optimization_solver::iterative_solver::Input
183 {
184 public:
185  typedef optimization_solver::iterative_solver::Input super;
186  Input();
187  Input(const Input& other);
188  using super::set;
189  using super::get;
190 
196  data_management::NumericTablePtr get(OptionalDataId id) const;
197 
203  void set(OptionalDataId id, const data_management::NumericTablePtr &ptr);
204 
212  virtual services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
213 };
214 /* [Input source code] */
215 
220 class DAAL_EXPORT Result : public optimization_solver::iterative_solver::Result
221 {
222 public:
223  DECLARE_SERIALIZABLE_CAST(Result);
224  typedef optimization_solver::iterative_solver::Result super;
225 
226  Result() {}
227  using super::set;
228  using super::get;
229 
236  template <typename algorithmFPType>
237  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, const int method);
238 
244  data_management::NumericTablePtr get(OptionalDataId id) const;
245 
251  void set(OptionalDataId id, const data_management::NumericTablePtr &ptr);
252 
261  virtual services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par,
262  int method) const DAAL_C11_OVERRIDE;
263 };
264 typedef services::SharedPtr<Result> ResultPtr;
265 /* [Result source code] */
266 
268 } // namespace interface1
269 using interface1::Parameter;
270 using interface1::Input;
271 using interface1::Result;
272 using interface1::ResultPtr;
273 
274 } // namespace lbfgs
275 } // namespace optimization_solver
276 } // namespace algorithm
277 } // namespace daal
278 #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::optimization_solver::iterative_solver::interface1::Result
Results obtained with the compute() method of the iterative solver algorithm in the batch processing ...
Definition: iterative_solver_types.h:247
daal::algorithms::optimization_solver::lbfgs::OptionalDataId
OptionalDataId
Definition: lbfgs_types.h:100
daal::algorithms::optimization_solver::lbfgs::interface1::Input
Input class for LBFGS algorithm
Definition: lbfgs_types.h:182
daal::algorithms::optimization_solver::iterative_solver::interface1::Parameter
Parameter base class for the iterative solver algorithm
Definition: iterative_solver_types.h:139
daal::algorithms::optimization_solver::iterative_solver::interface1::Input
Input parameters for the iterative solver algorithm
Definition: iterative_solver_types.h:184
daal::algorithms::em_gmm::nIterations
Definition: em_gmm_types.h:123
daal::algorithms::optimization_solver::lbfgs::interface1::Parameter::L
size_t L
Definition: lbfgs_types.h:151
daal::algorithms::optimization_solver::lbfgs::interface1::Parameter::m
size_t m
Definition: lbfgs_types.h:148
daal::algorithms::optimization_solver::lbfgs::correctionIndices
Definition: lbfgs_types.h:105
daal_defines.h
daal::algorithms::interface1::Parameter
Base class to represent computation parameters. Algorithm-specific parameters are represented as deri...
Definition: algorithm_types.h:86
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::optimization_solver::lbfgs::defaultDense
Definition: lbfgs_types.h:93
daal::algorithms::optimization_solver::lbfgs::Method
Method
Definition: lbfgs_types.h:91
daal::algorithms::optimization_solver::lbfgs::interface1::Parameter::stepLengthSequence
data_management::NumericTablePtr stepLengthSequence
Definition: lbfgs_types.h:164
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:220
daal::algorithms::optimization_solver::lbfgs::averageArgumentLIterations
Definition: lbfgs_types.h:108
daal::algorithms::optimization_solver::lbfgs::interface1::Parameter::seed
size_t seed
Definition: lbfgs_types.h:152
daal::algorithms::optimization_solver::lbfgs::correctionPairs
Definition: lbfgs_types.h:102
daal::algorithms::optimization_solver::lbfgs::interface1::Parameter::engine
engines::EnginePtr engine
Definition: lbfgs_types.h:153
daal::algorithms::optimization_solver::lbfgs::interface1::Parameter
Parameter class for LBFGS algorithm
Definition: lbfgs_types.h:128
daal::algorithms::optimization_solver::lbfgs::interface1::Parameter::correctionPairBatchIndices
data_management::NumericTablePtr correctionPairBatchIndices
Definition: lbfgs_types.h:160
daal::algorithms::interface1::Input
Base class to represent computation input arguments. Algorithm-specific input arguments are represent...
Definition: algorithm_types.h:217
daal::algorithms::optimization_solver::lbfgs::interface1::Parameter::correctionPairBatchSize
size_t correctionPairBatchSize
Definition: lbfgs_types.h:157

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