25 #ifndef __LOGISTIC_LOSS_BATCH_H__
26 #define __LOGISTIC_LOSS_BATCH_H__
28 #include "algorithms/algorithm.h"
29 #include "data_management/data/numeric_table.h"
30 #include "services/daal_defines.h"
31 #include "sum_of_functions_batch.h"
32 #include "logistic_loss_types.h"
38 namespace optimization_solver
40 namespace logistic_loss
59 template<
typename algorithmFPType, Method method, CpuType cpu>
60 class BatchContainer :
public daal::algorithms::AnalysisContainerIface<batch>
68 DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv);
70 DAAL_DEPRECATED_VIRTUAL
virtual ~BatchContainer();
76 DAAL_DEPRECATED_VIRTUAL
virtual services::Status compute() DAAL_C11_OVERRIDE;
95 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
96 class DAAL_EXPORT Batch :
public sum_of_functions::interface1::Batch
99 typedef sum_of_functions::interface1::Batch super;
100 typedef algorithms::optimization_solver::logistic_loss::interface1::Input InputType;
101 typedef algorithms::optimization_solver::logistic_loss::interface1::Parameter ParameterType;
102 typedef typename super::ResultType ResultType;
107 DAAL_DEPRECATED Batch(
size_t numberOfTerms) : sum_of_functions::interface1::Batch(numberOfTerms, &input, new ParameterType(numberOfTerms))
112 DAAL_DEPRECATED_VIRTUAL
virtual ~Batch() {}
120 DAAL_DEPRECATED Batch(
const Batch<algorithmFPType, method> &other) :
121 sum_of_functions::interface1::Batch(other.parameter().numberOfTerms, &input, new ParameterType(other.parameter())), input(other.input)
130 DAAL_DEPRECATED_VIRTUAL
virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
137 DAAL_DEPRECATED services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
139 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
147 DAAL_DEPRECATED services::Status allocate()
149 return allocateResult();
156 DAAL_DEPRECATED ParameterType& parameter() {
return *
static_cast<ParameterType*
>(_par); }
162 DAAL_DEPRECATED
const ParameterType& parameter()
const {
return *
static_cast<const ParameterType*
>(_par); }
169 DAAL_DEPRECATED
static services::SharedPtr<Batch<algorithmFPType, method> > create(
size_t numberOfTerms);
172 virtual Batch<algorithmFPType, method> *cloneImpl() const DAAL_C11_OVERRIDE
174 return new Batch<algorithmFPType, method>(*this);
177 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
179 services::Status s = _result->allocate<algorithmFPType>(&input, _par, (int) method);
180 _res = _result.get();
186 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
188 _par = sumOfFunctionsParameter;
213 template<
typename algorithmFPType, Method method, CpuType cpu>
214 class BatchContainer :
public daal::algorithms::AnalysisContainerIface<batch>
222 BatchContainer(daal::services::Environment::env *daalEnv);
224 virtual ~BatchContainer();
230 virtual services::Status compute() DAAL_C11_OVERRIDE;
249 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
250 class DAAL_EXPORT Batch :
public sum_of_functions::Batch
253 typedef sum_of_functions::Batch super;
254 typedef algorithms::optimization_solver::logistic_loss::Input InputType;
255 typedef algorithms::optimization_solver::logistic_loss::Parameter ParameterType;
256 typedef typename super::ResultType ResultType;
261 Batch(
size_t numberOfTerms);
271 Batch(
const Batch<algorithmFPType, method> &other);
277 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
284 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
286 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
294 services::Status allocate()
296 return allocateResult();
303 ParameterType& parameter() {
return *
static_cast<ParameterType*
>(_par); }
309 const ParameterType& parameter()
const {
return *
static_cast<const ParameterType*
>(_par); }
316 static services::SharedPtr<Batch<algorithmFPType, method> > create(
size_t numberOfTerms);
319 virtual Batch<algorithmFPType, method> *cloneImpl() const DAAL_C11_OVERRIDE
321 return new Batch<algorithmFPType, method>(*this);
324 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
326 services::Status s = _result->allocate<algorithmFPType>(&input, _par, (int) method);
327 _res = _result.get();
333 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
335 _par = sumOfFunctionsParameter;
344 using interface2::BatchContainer;
345 using interface2::Batch;
daal::algorithms::optimization_solver::logistic_loss::interface1::Batch::parameter
DAAL_DEPRECATED ParameterType & parameter()
Definition: logistic_loss_batch.h:156
daal::batch
Definition: daal_defines.h:112
daal::algorithms::optimization_solver::logistic_loss::interface2::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: logistic_loss_batch.h:284
daal::algorithms::optimization_solver::logistic_loss::interface1::Parameter
Parameter for Logistic loss objective function
Definition: logistic_loss_types.h:87
daal::algorithms::optimization_solver::logistic_loss::interface2::BatchContainer::compute
virtual services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::optimization_solver::logistic_loss::interface2::Batch::parameter
ParameterType & parameter()
Definition: logistic_loss_batch.h:303
daal::algorithms::optimization_solver::logistic_loss::interface1::Batch::allocate
DAAL_DEPRECATED services::Status allocate()
Definition: logistic_loss_batch.h:147
daal::algorithms::optimization_solver::logistic_loss::interface1::BatchContainer::BatchContainer
DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::optimization_solver::sum_of_functions::interface1::Batch
Interface for computing the Sum of functions in the batch processing mode.
Definition: sum_of_functions_batch.h:63
daal::algorithms::optimization_solver::logistic_loss::interface1::BatchContainer::~BatchContainer
virtual DAAL_DEPRECATED_VIRTUAL ~BatchContainer()
daal::algorithms::optimization_solver::logistic_loss::interface2::Batch
Computes the Logistic loss objective function in the batch processing mode.
Definition: logistic_loss_batch.h:250
daal::algorithms::optimization_solver::logistic_loss::interface1::Input
Input objects for the Logistic loss objective function
Definition: logistic_loss_types.h:126
daal::algorithms::AnalysisContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the analy...
Definition: analysis.h:55
daal::algorithms::optimization_solver::logistic_loss::interface2::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: logistic_loss_batch.h:277
daal::algorithms::optimization_solver::logistic_loss::interface1::Batch::Batch
DAAL_DEPRECATED Batch(size_t numberOfTerms)
Definition: logistic_loss_batch.h:107
daal::algorithms::optimization_solver::logistic_loss::interface2::BatchContainer::~BatchContainer
virtual ~BatchContainer()
daal::algorithms::optimization_solver::logistic_loss::interface1::Batch::getMethod
virtual DAAL_DEPRECATED_VIRTUAL int getMethod() const DAAL_C11_OVERRIDE
Definition: logistic_loss_batch.h:130
daal::algorithms::optimization_solver::logistic_loss::interface1::Batch::Batch
DAAL_DEPRECATED Batch(const Batch< algorithmFPType, method > &other)
Definition: logistic_loss_batch.h:120
daal::algorithms::optimization_solver::logistic_loss::interface2::BatchContainer
Provides methods to run implementations of the Logistic loss objective function. This class is associ...
Definition: logistic_loss_batch.h:214
daal::algorithms::optimization_solver::logistic_loss::interface2::Batch::allocate
services::Status allocate()
Definition: logistic_loss_batch.h:294
daal::algorithms::optimization_solver::logistic_loss::interface2::Batch::input
InputType input
Definition: logistic_loss_batch.h:339
daal::algorithms::optimization_solver::logistic_loss::interface1::Batch::input
InputType input
Definition: logistic_loss_batch.h:192
daal::algorithms::optimization_solver::logistic_loss::interface1::Batch
Computes the Logistic loss objective function in the batch processing mode.
Definition: logistic_loss_batch.h:96
daal::algorithms::optimization_solver::logistic_loss::interface2::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::optimization_solver::logistic_loss::interface1::BatchContainer
Provides methods to run implementations of the Logistic loss objective function. This class is associ...
Definition: logistic_loss_batch.h:60
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:70
daal::algorithms::optimization_solver::logistic_loss::interface2::Batch::parameter
const ParameterType & parameter() const
Definition: logistic_loss_batch.h:309
daal::algorithms::optimization_solver::logistic_loss::interface1::BatchContainer::compute
virtual DAAL_DEPRECATED_VIRTUAL services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::optimization_solver::logistic_loss::interface1::Batch::parameter
DAAL_DEPRECATED const ParameterType & parameter() const
Definition: logistic_loss_batch.h:162
daal::algorithms::optimization_solver::logistic_loss::interface1::Batch::clone
DAAL_DEPRECATED services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: logistic_loss_batch.h:137