25 #ifndef __ADA_BOOST_TRAINING_BATCH_H__
26 #define __ADA_BOOST_TRAINING_BATCH_H__
28 #include "algorithms/boosting/boosting_training_batch.h"
29 #include "algorithms/boosting/adaboost_training_types.h"
30 #include "algorithms/classifier/classifier_training_batch.h"
57 template<
typename algorithmFPType, Method method, CpuType cpu>
58 class BatchContainer :
public TrainingContainerIface<batch>
65 DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv);
67 DAAL_DEPRECATED ~BatchContainer();
71 DAAL_DEPRECATED services::Status compute() DAAL_C11_OVERRIDE;
91 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
92 class DAAL_EXPORT Batch :
public boosting::training::Batch
95 typedef boosting::training::Batch super;
97 typedef typename super::InputType InputType;
98 typedef algorithms::adaboost::interface1::Parameter ParameterType;
99 typedef algorithms::adaboost::training::interface1::Result ResultType;
101 ParameterType parameter;
104 DAAL_DEPRECATED Batch()
115 DAAL_DEPRECATED Batch(
const Batch<algorithmFPType, method> &other) : boosting::training::Batch(other),
116 parameter(other.parameter), input(other.input)
121 DAAL_DEPRECATED_VIRTUAL
virtual ~Batch() {}
127 DAAL_DEPRECATED InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
133 DAAL_DEPRECATED_VIRTUAL
virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
139 DAAL_DEPRECATED interface1::ResultPtr getResult()
141 return ResultType::cast(_result);
147 DAAL_DEPRECATED services::Status resetResult() DAAL_C11_OVERRIDE
149 _result.reset(
new ResultType());
150 DAAL_CHECK(_result, services::ErrorNullResult);
152 return services::Status();
160 DAAL_DEPRECATED services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
162 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
166 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
168 return new Batch<algorithmFPType, method>(*this);
171 services::Status allocateResult() DAAL_C11_OVERRIDE
173 interface1::ResultPtr res = getResult();
174 DAAL_CHECK(res, services::ErrorNullResult);
175 services::Status s = res->template allocate<algorithmFPType>(&input, _par, method);
176 _res = _result.get();
182 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
185 _result.reset(
new ResultType());
207 template<
typename algorithmFPType, Method method, CpuType cpu>
208 class BatchContainer :
public TrainingContainerIface<batch>
215 BatchContainer(daal::services::Environment::env *daalEnv);
221 services::Status compute() DAAL_C11_OVERRIDE;
240 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
241 class DAAL_EXPORT Batch :
public classifier::training::Batch
244 typedef classifier::training::Batch super;
246 typedef typename super::InputType InputType;
247 typedef algorithms::adaboost::Parameter ParameterType;
248 typedef algorithms::adaboost::training::Result ResultType;
252 Batch(
size_t nClasses);
260 Batch(
const Batch<algorithmFPType, method> &other);
271 ParameterType& parameter() {
return *
static_cast<ParameterType*
>(_par); }
277 const ParameterType& parameter()
const {
return *
static_cast<const ParameterType*
>(_par); }
283 InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
289 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
295 ResultPtr getResult()
297 return ResultType::cast(_result);
303 services::Status resetResult() DAAL_C11_OVERRIDE
305 _result.reset(
new ResultType());
306 DAAL_CHECK(_result, services::ErrorNullResult);
308 return services::Status();
316 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
318 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
322 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
324 return new Batch<algorithmFPType, method>(*this);
327 services::Status allocateResult() DAAL_C11_OVERRIDE
329 ResultPtr res = getResult();
330 DAAL_CHECK(res, services::ErrorNullResult);
331 services::Status s = res->template allocate<algorithmFPType>(&input, _par, method);
332 _res = _result.get();
338 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
340 _result.reset(
new ResultType());
345 using interface2::Batch;
346 using interface2::BatchContainer;
352 #endif // __ADA_BOOST_TRAINING_BATCH_H__
daal::algorithms::adaboost::training::interface2::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::adaboost::training::interface1::Batch::input
InputType input
Definition: adaboost_training_batch.h:102
daal::algorithms::adaboost::training::interface1::Batch::getInput
DAAL_DEPRECATED InputType * getInput() DAAL_C11_OVERRIDE
Definition: adaboost_training_batch.h:127
daal::algorithms::adaboost::training::interface2::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: adaboost_training_batch.h:289
daal::algorithms::adaboost::training::interface1::Batch::getResult
DAAL_DEPRECATED interface1::ResultPtr getResult()
Definition: adaboost_training_batch.h:139
daal::algorithms::adaboost::training::interface1::BatchContainer
Provides methods to run implementations of AdaBoost model-based training. It is associated with daal:...
Definition: adaboost_training_batch.h:58
daal::batch
Definition: daal_defines.h:112
daal::algorithms::adaboost::training::interface1::Batch
Trains model of the AdaBoost algorithms in batch mode.
Definition: adaboost_training_batch.h:92
daal::algorithms::adaboost::training::interface2::Batch::getResult
ResultPtr getResult()
Definition: adaboost_training_batch.h:295
daal::algorithms::adaboost::training::interface1::BatchContainer::compute
DAAL_DEPRECATED services::Status compute() DAAL_C11_OVERRIDE
daal::services::ErrorNullResult
Definition: error_indexes.h:98
daal::algorithms::adaboost::training::interface1::Batch::clone
DAAL_DEPRECATED services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: adaboost_training_batch.h:160
daal::algorithms::adaboost::training::interface1::Batch::getMethod
virtual DAAL_DEPRECATED_VIRTUAL int getMethod() const DAAL_C11_OVERRIDE
Definition: adaboost_training_batch.h:133
daal::algorithms::adaboost::interface1::Parameter
AdaBoost algorithm parameters.
Definition: adaboost_model.h:59
daal::algorithms::adaboost::training::interface1::Result
Provides methods to access final results obtained with the compute() method.
Definition: adaboost_training_types.h:84
daal::algorithms::adaboost::training::interface2::Batch::parameter
const ParameterType & parameter() const
Definition: adaboost_training_batch.h:277
daal::algorithms::adaboost::training::interface1::BatchContainer::BatchContainer
DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::adaboost::training::interface2::Batch::input
InputType input
Definition: adaboost_training_batch.h:250
daal::algorithms::adaboost::training::interface2::BatchContainer
Provides methods to run implementations of AdaBoost model-based training. It is associated with daal:...
Definition: adaboost_training_batch.h:208
daal::algorithms::adaboost::training::interface2::Batch
Trains model of the AdaBoost algorithms in batch mode.
Definition: adaboost_training_batch.h:241
daal::algorithms::adaboost::training::interface2::BatchContainer::~BatchContainer
~BatchContainer()
daal::algorithms::adaboost::training::interface1::Batch::resetResult
DAAL_DEPRECATED services::Status resetResult() DAAL_C11_OVERRIDE
Definition: adaboost_training_batch.h:147
daal::algorithms::adaboost::training::interface2::Batch::resetResult
services::Status resetResult() DAAL_C11_OVERRIDE
Definition: adaboost_training_batch.h:303
daal::algorithms::adaboost::training::interface1::BatchContainer::~BatchContainer
DAAL_DEPRECATED ~BatchContainer()
daal::algorithms::adaboost::training::interface2::BatchContainer::compute
services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::adaboost::training::interface2::Batch::parameter
ParameterType & parameter()
Definition: adaboost_training_batch.h:271
daal::algorithms::TrainingContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the model...
Definition: training.h:52
daal::algorithms::adaboost::training::interface2::Batch::getInput
InputType * getInput() DAAL_C11_OVERRIDE
Definition: adaboost_training_batch.h:283
daal::algorithms::adaboost::training::interface1::Batch::parameter
ParameterType parameter
Definition: adaboost_training_batch.h:101
daal::algorithms::adaboost::training::interface2::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: adaboost_training_batch.h:316
daal::algorithms::adaboost::training::interface1::Batch::Batch
DAAL_DEPRECATED Batch(const Batch< algorithmFPType, method > &other)
Definition: adaboost_training_batch.h:115