49 #ifndef __SGD_BATCH_H__ 50 #define __SGD_BATCH_H__ 52 #include "algorithms/algorithm.h" 53 #include "data_management/data/numeric_table.h" 54 #include "services/daal_defines.h" 55 #include "algorithms/optimization_solver/iterative_solver/iterative_solver_batch.h" 56 #include "sgd_types.h" 62 namespace optimization_solver
81 template<
typename algorithmFPType, Method method, CpuType cpu>
82 class DAAL_EXPORT BatchContainer :
public daal::algorithms::AnalysisContainerIface<batch>
90 BatchContainer(daal::services::Environment::env *daalEnv);
98 virtual services::Status compute() DAAL_C11_OVERRIDE;
118 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
119 class DAAL_EXPORT Batch :
public iterative_solver::Batch
122 typedef algorithms::optimization_solver::sgd::Input InputType;
123 typedef algorithms::optimization_solver::sgd::Parameter<method> ParameterType;
124 typedef algorithms::optimization_solver::sgd::Result ResultType;
127 Parameter<method> parameter;
133 Batch(
const sum_of_functions::BatchPtr& objectiveFunction = sum_of_functions::BatchPtr()) :
135 parameter(objectiveFunction)
146 Batch(
const Batch<algorithmFPType, method> &other) :
147 iterative_solver::Batch(other),
149 parameter(other.parameter)
158 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
164 virtual iterative_solver::Input * getInput() DAAL_C11_OVERRIDE {
return &input; }
170 virtual iterative_solver::Parameter * getParameter() DAAL_C11_OVERRIDE {
return ¶meter; }
177 virtual services::Status createResult() DAAL_C11_OVERRIDE
179 _result = iterative_solver::ResultPtr(
new ResultType());
181 return services::Status();
189 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const 191 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
195 virtual Batch<algorithmFPType, method> *cloneImpl()
const DAAL_C11_OVERRIDE
197 return new Batch<algorithmFPType, method>(*this);
200 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
202 services::Status s =
static_cast<ResultType*
>(_result.get())->allocate<algorithmFPType>(&input, ¶meter, (
int)method);
203 _res = _result.get();
209 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
212 _result = iterative_solver::ResultPtr(
new ResultType());
217 using interface1::BatchContainer;
218 using interface1::Batch;
daal::algorithms::optimization_solver::sgd::interface1::Batch::input
InputType input
Definition: sgd_batch.h:126
daal::algorithms::optimization_solver::sgd::interface1::Batch::Batch
Batch(const sum_of_functions::BatchPtr &objectiveFunction=sum_of_functions::BatchPtr())
Definition: sgd_batch.h:133
daal::services::interface1::Environment::_envStruct
The environment structure.
Definition: env_detect.h:95
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::AnalysisContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the analy...
Definition: analysis.h:79
daal::algorithms::optimization_solver::sgd::interface1::Parameter
Definition: sgd_types.h:156
daal::algorithms::optimization_solver::sgd::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: sgd_batch.h:158
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::sgd::interface1::Batch::getParameter
virtual iterative_solver::Parameter * getParameter() DAAL_C11_OVERRIDE
Definition: sgd_batch.h:170
daal::batch
Definition: daal_defines.h:132
daal::algorithms::optimization_solver::sgd::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: sgd_batch.h:146
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::sgd::interface1::BatchContainer
Provides methods to run implementations of the stochastic gradient descent algorithm. This class is associated with daal::algorithms::optimization_solver::sgd::BatchContainer class.
Definition: sgd_batch.h:82
daal::algorithms::optimization_solver::sgd::interface1::Batch::parameter
Parameter< method > parameter
Definition: sgd_batch.h:127
daal::algorithms::optimization_solver::sgd::interface1::Result
Results obtained with the compute() method of the sgd algorithm in the batch processing mode...
Definition: sgd_types.h:350
daal::algorithms::optimization_solver::sgd::interface1::Batch
Computes Stochastic gradient descent in the batch processing mode.
Definition: sgd_batch.h:119
daal::algorithms::optimization_solver::sgd::interface1::Batch::getInput
virtual iterative_solver::Input * getInput() DAAL_C11_OVERRIDE
Definition: sgd_batch.h:164
daal::algorithms::optimization_solver::sgd::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: sgd_batch.h:189
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:94
daal::algorithms::optimization_solver::sgd::interface1::Batch::createResult
virtual services::Status createResult() DAAL_C11_OVERRIDE
Definition: sgd_batch.h:177
daal::algorithms::optimization_solver::iterative_solver::interface1::Batch
Interface for computing the iterative solver in the batch processing mode.
Definition: iterative_solver_batch.h:78