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

saga_types.h
1 /* file: saga_types.h */
2 /*******************************************************************************
3 * Copyright 2014-2019 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 Stochastic average gradient descent algorithm types.
19 //--
20 */
21 
22 #ifndef __SAGA_TYPES_H__
23 #define __SAGA_TYPES_H__
24 
25 #include "data_management/data/numeric_table.h"
26 #include "data_management/data/homogen_numeric_table.h"
27 #include "services/daal_defines.h"
28 #include "algorithms/optimization_solver/iterative_solver/iterative_solver_types.h"
29 #include "algorithms/engines/mt19937/mt19937.h"
30 #include "algorithms/optimization_solver/objective_function/logistic_loss_batch.h"
31 
32 namespace daal
33 {
34 namespace algorithms
35 {
36 namespace optimization_solver
37 {
47 namespace saga
48 {
49 
54 enum Method
55 {
56  defaultDense = 0,
57 };
58 
63 enum OptionalDataId
64 {
65  gradientsTable = iterative_solver::lastOptionalData + 1,
68  lastOptionalData = gradientsTable
69 };
70 
74 namespace interface1
75 {
76 
83 /* [Parameter source code] */
84 struct DAAL_EXPORT Parameter : public optimization_solver::iterative_solver::Parameter
85 {
99  Parameter(
100  const sum_of_functions::BatchPtr &function,
101  size_t nIterations = 100,
102  double accuracyThreshold = 1.0e-05,
103  const data_management::NumericTablePtr batchIndices = data_management::NumericTablePtr(),
104  const size_t batchSize = 128,
105  const data_management::NumericTablePtr learningRateSequence = data_management::NumericTablePtr(),
106  size_t seed = 777
107  );
108 
109  virtual ~Parameter(){}
110 
116  virtual services::Status check() const DAAL_C11_OVERRIDE;
117 
118  data_management::NumericTablePtr batchIndices;
121  data_management::NumericTablePtr learningRateSequence;
122  size_t seed;
124  engines::EnginePtr engine;
126 };
127 /* [Parameter source code] */
128 
135 /* [Input source code] */
136 class DAAL_EXPORT Input : public optimization_solver::iterative_solver::Input
137 {
138 private:
139  typedef optimization_solver::iterative_solver::Input super;
140 public:
141  Input();
142  Input(const Input& other);
143 
144  using super::set;
145  using super::get;
146 
152  data_management::NumericTablePtr get(OptionalDataId id) const;
153 
159  void set(OptionalDataId id, const data_management::NumericTablePtr &ptr);
160 
168  virtual services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
169 };
170 /* [Input source code] */
171 
176 class DAAL_EXPORT Result : public optimization_solver::iterative_solver::Result
177 {
178 public:
179  DECLARE_SERIALIZABLE_CAST(Result);
180  typedef optimization_solver::iterative_solver::Result super;
181 
182  Result() {}
183  using super::set;
184  using super::get;
185 
194  template <typename algorithmFPType>
195  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, const int method);
196 
202  data_management::NumericTablePtr get(OptionalDataId id) const;
203 
209  void set(OptionalDataId id, const data_management::NumericTablePtr &ptr);
210 
219  virtual services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par,
220  int method) const DAAL_C11_OVERRIDE;
221 };
222 typedef services::SharedPtr<Result> ResultPtr;
223 /* [Result source code] */
224 
226 } // namespace interface1
227 using interface1::Parameter;
228 using interface1::Input;
229 using interface1::Result;
230 using interface1::ResultPtr;
231 
232 } // namespace saga
233 } // namespace optimization_solver
234 } // namespace algorithm
235 } // namespace daal
236 #endif
daal::algorithms::optimization_solver::saga::interface1::Input
Input class for the Stochastic average gradient descent algorithm
Definition: saga_types.h:136
daal
Definition: algorithm_base_common.h:31
daal::algorithms::em_gmm::nIterations
Definition: em_gmm_types.h:97
daal::algorithms::optimization_solver::saga::OptionalDataId
OptionalDataId
Definition: saga_types.h:63
daal_defines.h
daal::algorithms::optimization_solver::saga::defaultDense
Definition: saga_types.h:56
daal::algorithms::optimization_solver::saga::interface1::Parameter::learningRateSequence
data_management::NumericTablePtr learningRateSequence
Definition: saga_types.h:121
daal::algorithms::optimization_solver::saga::gradientsTable
Definition: saga_types.h:65
daal::algorithms::optimization_solver::saga::Method
Method
Definition: saga_types.h:54
daal::algorithms::optimization_solver::saga::interface1::Parameter::engine
engines::EnginePtr engine
Definition: saga_types.h:124
daal::algorithms::optimization_solver::saga::interface1::Parameter::seed
size_t seed
Definition: saga_types.h:122
daal::algorithms::optimization_solver::saga::interface1::Parameter
Parameter base class for the Stochastic average gradient descent algorithm
Definition: saga_types.h:84
daal::algorithms::optimization_solver::saga::interface1::Parameter::batchIndices
data_management::NumericTablePtr batchIndices
Definition: saga_types.h:118
daal::algorithms::optimization_solver::saga::interface1::Result
Results obtained with the compute() method of the saga algorithm in the batch processing mode...
Definition: saga_types.h:176

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