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

adagrad_types.h
1 /* file: adagrad_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 Adaptive gradient descent algorithm types.
19 //--
20 */
21 
22 #ifndef __ADAGRAD_TYPES_H__
23 #define __ADAGRAD_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 "services/daal_defines.h"
29 #include "algorithms/optimization_solver/iterative_solver/iterative_solver_types.h"
30 #include "algorithms/engines/mt19937/mt19937.h"
31 
32 namespace daal
33 {
34 namespace algorithms
35 {
36 namespace optimization_solver
37 {
47 namespace adagrad
48 {
49 
54 enum Method
55 {
56  defaultDense = 0,
57 };
58 
63 enum OptionalDataId
64 {
65  gradientSquareSum = iterative_solver::lastOptionalData + 1,
68  lastOptionalData = gradientSquareSum
69 };
70 
74 namespace interface1
75 {
76 
83 /* [Parameter source code] */
84 struct DAAL_EXPORT Parameter : public optimization_solver::iterative_solver::Parameter
85 {
100  Parameter(
101  const sum_of_functions::BatchPtr &function_,
102  size_t nIterations_ = 100,
103  double accuracyThreshold_ = 1.0e-05,
104  data_management::NumericTablePtr batchIndices_ = data_management::NumericTablePtr(),
105  const size_t batchSize_ = 128,
106  data_management::NumericTablePtr learningRate_ = data_management::HomogenNumericTable<double>::create(1, 1, data_management::NumericTableIface::doAllocate, 0.01),
107  double degenerateCasesThreshold_ = 1.0e-08,
108  size_t seed_ = 777
109  );
110 
111  virtual ~Parameter() {}
112 
118  virtual services::Status check() const DAAL_C11_OVERRIDE;
119 
120  data_management::NumericTablePtr batchIndices;
123  data_management::NumericTablePtr learningRate;
124  double degenerateCasesThreshold;
125  size_t seed;
127  engines::EnginePtr engine;
129 };
130 /* [Parameter source code] */
131 
138 /* [Input source code] */
139 class DAAL_EXPORT Input : public optimization_solver::iterative_solver::Input
140 {
141 public:
142  typedef optimization_solver::iterative_solver::Input super;
143  Input();
144  Input(const Input& other);
145 
146  using super::set;
147  using super::get;
148 
154  data_management::NumericTablePtr get(OptionalDataId id) const;
155 
161  void set(OptionalDataId id, const data_management::NumericTablePtr &ptr);
162 
170  virtual services::Status check(const daal::algorithms::Parameter *par, int method) const DAAL_C11_OVERRIDE;
171 };
172 /* [Input source code] */
173 
178 class DAAL_EXPORT Result : public optimization_solver::iterative_solver::Result
179 {
180 public:
181  DECLARE_SERIALIZABLE_CAST(Result);
182  typedef optimization_solver::iterative_solver::Result super;
183 
184  Result() {}
185  using super::set;
186  using super::get;
187 
196  template <typename algorithmFPType>
197  DAAL_EXPORT services::Status allocate(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par, const int method);
198 
204  data_management::NumericTablePtr get(OptionalDataId id) const;
205 
211  void set(OptionalDataId id, const data_management::NumericTablePtr &ptr);
212 
221  virtual services::Status check(const daal::algorithms::Input *input, const daal::algorithms::Parameter *par,
222  int method) const DAAL_C11_OVERRIDE;
223 };
224 typedef services::SharedPtr<Result> ResultPtr;
225 /* [Result source code] */
226 
228 } // namespace interface1
229 using interface1::Parameter;
230 using interface1::Input;
231 using interface1::Result;
232 using interface1::ResultPtr;
233 
234 } // namespace adagrad
235 } // namespace optimization_solver
236 } // namespace algorithm
237 } // namespace daal
238 #endif
daal::algorithms::optimization_solver::adagrad::interface1::Parameter::engine
engines::EnginePtr engine
Definition: adagrad_types.h:127
daal
Definition: algorithm_base_common.h:31
daal::algorithms::optimization_solver::adagrad::interface1::Parameter::seed
size_t seed
Definition: adagrad_types.h:125
daal::algorithms::optimization_solver::adagrad::interface1::Result
Results obtained with the compute() method of the adagrad algorithm in the batch processing mode...
Definition: adagrad_types.h:178
daal::algorithms::optimization_solver::adagrad::interface1::Parameter::learningRate
data_management::NumericTablePtr learningRate
Definition: adagrad_types.h:123
daal::algorithms::optimization_solver::adagrad::OptionalDataId
OptionalDataId
Definition: adagrad_types.h:63
daal_defines.h
daal::algorithms::optimization_solver::adagrad::defaultDense
Definition: adagrad_types.h:56
daal::algorithms::optimization_solver::adagrad::interface1::Parameter::batchIndices
data_management::NumericTablePtr batchIndices
Definition: adagrad_types.h:120
daal::algorithms::optimization_solver::adagrad::interface1::Input
Input class for the Adaptive gradient descent algorithm
Definition: adagrad_types.h:139
daal::algorithms::optimization_solver::adagrad::interface1::Parameter::degenerateCasesThreshold
double degenerateCasesThreshold
Definition: adagrad_types.h:124
daal::algorithms::optimization_solver::adagrad::gradientSquareSum
Definition: adagrad_types.h:65
daal::algorithms::optimization_solver::adagrad::Method
Method
Definition: adagrad_types.h:54
daal::algorithms::optimization_solver::adagrad::interface1::Parameter
Parameter base class for the Adaptive gradient descent algorithm
Definition: adagrad_types.h:84

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