23 #ifndef __ADA_BOOST_TRAINING_BATCH_H__
24 #define __ADA_BOOST_TRAINING_BATCH_H__
26 #include "algorithms/boosting/boosting_training_batch.h"
27 #include "algorithms/boosting/adaboost_training_types.h"
54 template<
typename algorithmFPType, Method method, CpuType cpu>
55 class DAAL_EXPORT BatchContainer :
public TrainingContainerIface<batch>
62 BatchContainer(daal::services::Environment::env *daalEnv);
68 services::Status compute() DAAL_C11_OVERRIDE;
88 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
89 class DAAL_EXPORT Batch :
public boosting::training::Batch
92 typedef boosting::training::Batch super;
94 typedef typename super::InputType InputType;
95 typedef algorithms::adaboost::Parameter ParameterType;
96 typedef algorithms::adaboost::training::Result ResultType;
98 ParameterType parameter;
112 Batch(
const Batch<algorithmFPType, method> &other) : boosting::training::Batch(other),
113 parameter(other.parameter), input(other.input)
124 InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
130 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
136 ResultPtr getResult()
138 return ResultType::cast(_result);
144 services::Status resetResult() DAAL_C11_OVERRIDE
146 _result.reset(
new ResultType());
147 DAAL_CHECK(_result, services::ErrorNullResult);
149 return services::Status();
157 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
159 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
163 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
165 return new Batch<algorithmFPType, method>(*this);
168 services::Status allocateResult() DAAL_C11_OVERRIDE
170 ResultPtr res = getResult();
171 DAAL_CHECK(res, services::ErrorNullResult);
172 services::Status s = res->template allocate<algorithmFPType>(&input, _par, method);
173 _res = _result.get();
179 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
182 _result.reset(
new ResultType());
187 using interface1::BatchContainer;
188 using interface1::Batch;
194 #endif // __ADA_BOOST_TRAINING_BATCH_H__
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:55
daal
Definition: algorithm_base_common.h:31
daal::batch
Definition: daal_defines.h:110
daal::algorithms::adaboost::training::interface1::Batch
Trains model of the AdaBoost algorithms in batch mode.
Definition: adaboost_training_batch.h:89
daal::algorithms::adaboost::training::interface1::Batch::resetResult
services::Status resetResult() DAAL_C11_OVERRIDE
Definition: adaboost_training_batch.h:144
daal::algorithms::adaboost::training::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: adaboost_training_batch.h:157
daal::algorithms::adaboost::training::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: adaboost_training_batch.h:112
daal::algorithms::adaboost::training::interface1::Batch::parameter
ParameterType parameter
Definition: adaboost_training_batch.h:98
daal::algorithms::adaboost::training::interface1::Batch::getInput
InputType * getInput() DAAL_C11_OVERRIDE
Definition: adaboost_training_batch.h:124
daal::algorithms::adaboost::training::interface1::Batch::getResult
ResultPtr getResult()
Definition: adaboost_training_batch.h:136
daal::algorithms::adaboost::training::interface1::Batch::input
InputType input
Definition: adaboost_training_batch.h:99
daal::algorithms::adaboost::training::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: adaboost_training_batch.h:130
daal::services::ErrorNullResult
Definition: error_indexes.h:96
daal::algorithms::TrainingContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the model...
Definition: training.h:50