22 #ifndef __UNIFORM_INITIALIZER_H__
23 #define __UNIFORM_INITIALIZER_H__
25 #include "algorithms/algorithm.h"
26 #include "data_management/data/tensor.h"
27 #include "services/daal_defines.h"
28 #include "algorithms/neural_networks/initializers/initializer.h"
29 #include "algorithms/neural_networks/initializers/initializer_types.h"
30 #include "algorithms/neural_networks/initializers/uniform/uniform_initializer_types.h"
36 namespace neural_networks
38 namespace initializers
59 template<
typename algorithmFPType, Method method, CpuType cpu>
60 class DAAL_EXPORT BatchContainer :
public initializers::InitializerContainerIface
68 BatchContainer(daal::services::Environment::env *daalEnv);
76 services::Status compute() DAAL_C11_OVERRIDE;
93 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
94 class DAAL_EXPORT Batch :
public initializers::InitializerIface
97 typedef initializers::InitializerIface super;
99 typedef typename super::InputType InputType;
100 typedef algorithms::neural_networks::initializers::uniform::Parameter ParameterType;
101 typedef typename super::ResultType ResultType;
103 ParameterType parameter;
110 Batch(
double a = -0.5,
double b = 0.5) : parameter(a, b)
120 Batch(
const Batch<algorithmFPType, method> &other): super(other), parameter(other.parameter)
129 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
135 virtual ParameterType * getParameter() DAAL_C11_OVERRIDE {
return ¶meter; }
141 ResultPtr getResult()
152 services::Status setResult(
const ResultPtr& result)
154 DAAL_CHECK(result, services::ErrorNullResult)
156 _res = _result.get();
157 return services::Status();
165 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
167 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
175 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
178 services::Status s = this->_result->template allocate<algorithmFPType>(&(this->input), ¶meter, (
int) method);
179 this->_res = this->_result.get();
184 virtual Batch<algorithmFPType, method> *cloneImpl() const DAAL_C11_OVERRIDE
186 return new Batch<algorithmFPType, method>(*this);
191 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
194 _result.reset(
new ResultType());
202 using interface1::BatchContainer;
203 using interface1::Batch;
daal
Definition: algorithm_base_common.h:31
daal::batch
Definition: daal_defines.h:110
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:68
daal::services::ErrorNullResult
Definition: error_indexes.h:96