22 #ifndef __XAVIER_INITIALIZER_H__
23 #define __XAVIER_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/xavier/xavier_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::xavier::Parameter ParameterType;
101 typedef typename super::ResultType ResultType;
103 ParameterType parameter;
118 Batch(
const Batch<algorithmFPType, method> &other) : super(other), parameter(other.parameter)
127 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
133 virtual ParameterType * getParameter() DAAL_C11_OVERRIDE {
return ¶meter; }
139 ResultPtr getResult()
150 services::Status setResult(
const ResultPtr &result)
153 _res = _result.get();
154 return services::Status();
162 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
164 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
172 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
175 services::Status s = this->_result->template allocate<algorithmFPType>(&(this->input), ¶meter, (
int) method);
176 this->_res = this->_result.get();
181 virtual Batch<algorithmFPType, method> *cloneImpl() const DAAL_C11_OVERRIDE
183 return new Batch<algorithmFPType, method>(*this);
188 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
191 _result.reset(
new ResultType());
199 using interface1::BatchContainer;
200 using interface1::Batch;
daal::algorithms::neural_networks::initializers::xavier::interface1::Batch::getResult
ResultPtr getResult()
Definition: xavier_initializer.h:139
daal::algorithms::neural_networks::initializers::xavier::interface1::Batch::getParameter
virtual ParameterType * getParameter() DAAL_C11_OVERRIDE
Definition: xavier_initializer.h:133
daal
Definition: algorithm_base_common.h:31
daal::algorithms::neural_networks::initializers::xavier::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: xavier_initializer.h:150
daal::algorithms::neural_networks::initializers::xavier::interface1::Batch
Provides methods for Xavier initializer computations in the batch processing mode.
Definition: xavier_initializer.h:94
daal::algorithms::neural_networks::initializers::xavier::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: xavier_initializer.h:118
daal::batch
Definition: daal_defines.h:106
daal::algorithms::neural_networks::initializers::xavier::interface1::BatchContainer
Provides methods to run implementations of the Xavier initializer. This class is associated with the ...
Definition: xavier_initializer.h:60
daal::algorithms::neural_networks::initializers::xavier::interface1::Batch::parameter
ParameterType parameter
Definition: xavier_initializer.h:103
daal::algorithms::neural_networks::initializers::xavier::interface1::Batch::allocateResult
virtual services::Status allocateResult() DAAL_C11_OVERRIDE
Definition: xavier_initializer.h:172
daal::algorithms::neural_networks::initializers::xavier::interface1::Batch::Batch
Batch()
Definition: xavier_initializer.h:108
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:68
daal::algorithms::neural_networks::initializers::xavier::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: xavier_initializer.h:127
daal::algorithms::neural_networks::initializers::xavier::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: xavier_initializer.h:162