48 #ifndef __XAVIER_INITIALIZER_H__ 49 #define __XAVIER_INITIALIZER_H__ 51 #include "algorithms/algorithm.h" 52 #include "data_management/data/tensor.h" 53 #include "services/daal_defines.h" 54 #include "algorithms/neural_networks/initializers/initializer.h" 55 #include "algorithms/neural_networks/initializers/initializer_types.h" 56 #include "algorithms/neural_networks/initializers/xavier/xavier_initializer_types.h" 62 namespace neural_networks
64 namespace initializers
85 template<
typename algorithmFPType, Method method, CpuType cpu>
86 class DAAL_EXPORT BatchContainer :
public initializers::InitializerContainerIface
94 BatchContainer(daal::services::Environment::env *daalEnv);
102 services::Status compute() DAAL_C11_OVERRIDE;
119 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
120 class DAAL_EXPORT Batch :
public initializers::InitializerIface
123 typedef initializers::InitializerIface super;
125 typedef typename super::InputType InputType;
126 typedef algorithms::neural_networks::initializers::xavier::Parameter ParameterType;
127 typedef typename super::ResultType ResultType;
129 ParameterType parameter;
144 Batch(
const Batch<algorithmFPType, method> &other) : super(other), parameter(other.parameter)
153 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
159 virtual ParameterType * getParameter() DAAL_C11_OVERRIDE {
return ¶meter; }
165 ResultPtr getResult()
176 services::Status setResult(
const ResultPtr &result)
179 _res = _result.get();
180 return services::Status();
188 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const 190 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
198 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
201 services::Status s = this->_result->template allocate<algorithmFPType>(&(this->input), ¶meter, (
int) method);
202 this->_res = this->_result.get();
207 virtual Batch<algorithmFPType, method> *cloneImpl()
const DAAL_C11_OVERRIDE
209 return new Batch<algorithmFPType, method>(*this);
214 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
217 _result.reset(
new ResultType());
225 using interface1::BatchContainer;
226 using interface1::Batch;
daal::algorithms::neural_networks::initializers::xavier::interface1::Batch::getParameter
virtual ParameterType * getParameter() DAAL_C11_OVERRIDE
Definition: xavier_initializer.h:159
daal::services::interface1::Environment::_envStruct
The environment structure.
Definition: env_detect.h:95
daal::services::interface1::Status
Class that holds the results of API calls. In case of API routine failure it contains the list of err...
Definition: error_handling.h:491
daal
Definition: algorithm_base_common.h:57
daal::algorithms::neural_networks::initializers::interface1::InitializerContainerIface
Class that specifies interfaces of implementations of the neural network weights and biases initializ...
Definition: initializer.h:74
daal::algorithms::neural_networks::initializers::xavier::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: xavier_initializer.h:176
daal::algorithms::neural_networks::initializers::xavier::interface1::Batch
Provides methods for Xavier initializer computations in the batch processing mode.
Definition: xavier_initializer.h:120
daal::algorithms::neural_networks::initializers::xavier::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: xavier_initializer.h:144
daal::batch
Definition: daal_defines.h:132
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:86
daal::services::interface1::SharedPtr
Shared pointer that retains shared ownership of an object through a pointer. Several SharedPtr object...
Definition: daal_shared_ptr.h:187
daal::algorithms::neural_networks::initializers::xavier::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: xavier_initializer.h:188
daal::algorithms::neural_networks::initializers::interface1::Result
Provides methods to access the result obtained with the compute() method of the neural network weight...
Definition: initializer_types.h:167
daal::algorithms::neural_networks::initializers::xavier::interface1::Batch::parameter
ParameterType parameter
Definition: xavier_initializer.h:129
daal::algorithms::neural_networks::initializers::xavier::interface1::Batch::allocateResult
virtual services::Status allocateResult() DAAL_C11_OVERRIDE
Definition: xavier_initializer.h:198
daal::algorithms::neural_networks::initializers::xavier::interface1::Batch::Batch
Batch()
Definition: xavier_initializer.h:134
daal::algorithms::neural_networks::initializers::interface1::InitializerIface
Class representing a neural network weights and biases initializer.
Definition: initializer.h:85
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:94
daal::algorithms::neural_networks::initializers::xavier::interface1::Parameter
Xavier initializer parameters.
Definition: xavier_initializer_types.h:95
daal::algorithms::neural_networks::initializers::xavier::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: xavier_initializer.h:153
daal::algorithms::neural_networks::initializers::interface1::Parameter
Definition: initializer_types.h:107