22 #ifndef __DROPOUT_LAYER_FORWARD_H__
23 #define __DROPOUT_LAYER_FORWARD_H__
25 #include "algorithms/algorithm.h"
26 #include "data_management/data/tensor.h"
27 #include "services/daal_defines.h"
28 #include "algorithms/neural_networks/layers/layer.h"
29 #include "algorithms/neural_networks/layers/dropout/dropout_layer_types.h"
30 #include "algorithms/neural_networks/layers/dropout/dropout_layer_forward_types.h"
36 namespace neural_networks
61 template<
typename algorithmFPType, Method method, CpuType cpu>
62 class DAAL_EXPORT BatchContainer :
public layers::forward::LayerContainerIfaceImpl
70 BatchContainer(daal::services::Environment::env *daalEnv);
78 services::Status compute() DAAL_C11_OVERRIDE;
79 services::Status setupCompute() DAAL_C11_OVERRIDE;
80 services::Status resetCompute() DAAL_C11_OVERRIDE;
101 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
102 class Batch :
public layers::forward::LayerIfaceImpl
105 typedef layers::forward::LayerIfaceImpl super;
107 typedef algorithms::neural_networks::layers::dropout::forward::Input InputType;
108 typedef algorithms::neural_networks::layers::dropout::Parameter ParameterType;
109 typedef algorithms::neural_networks::layers::dropout::forward::Result ResultType;
111 ParameterType ¶meter;
115 Batch() : parameter(_defaultParameter)
125 Batch(ParameterType& parameter) : parameter(parameter), _defaultParameter(parameter)
136 Batch(
const Batch<algorithmFPType, method> &other) : super(other),
137 _defaultParameter(other.parameter), parameter(_defaultParameter), input(other.input)
146 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
152 virtual InputType *getLayerInput() DAAL_C11_OVERRIDE {
return &input; }
158 virtual ParameterType *getLayerParameter() DAAL_C11_OVERRIDE {
return ¶meter; };
164 layers::forward::ResultPtr getLayerResult() DAAL_C11_OVERRIDE
173 ResultPtr getResult()
184 services::Status setResult(
const ResultPtr& result)
186 DAAL_CHECK(result, services::ErrorNullResult)
188 _res = _result.get();
189 return services::Status();
198 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
200 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
208 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
210 services::Status s = this->_result->template allocate<algorithmFPType>(&(this->input), ¶meter, (
int) method);
211 this->_res = this->_result.get();
216 virtual Batch<algorithmFPType, method> *cloneImpl() const DAAL_C11_OVERRIDE
218 return new Batch<algorithmFPType, method>(*this);
223 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_LAYER_CONTAINER(BatchContainer, algorithmFPType, method)(&_env);
226 _result.reset(
new ResultType());
231 ParameterType _defaultParameter;
235 using interface1::BatchContainer;
236 using interface1::Batch;
daal
Definition: algorithm_base_common.h:31
daal::algorithms::neural_networks::layers::dropout::forward::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: dropout_layer_forward.h:198
daal::algorithms::neural_networks::layers::dropout::forward::interface1::Batch::input
InputType input
Definition: dropout_layer_forward.h:112
daal::algorithms::neural_networks::layers::dropout::forward::interface1::Batch::getLayerInput
virtual InputType * getLayerInput() DAAL_C11_OVERRIDE
Definition: dropout_layer_forward.h:152
daal::algorithms::neural_networks::layers::dropout::forward::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: dropout_layer_forward.h:184
daal::algorithms::neural_networks::layers::dropout::forward::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: dropout_layer_forward.h:146
daal::algorithms::neural_networks::layers::dropout::forward::interface1::Batch
Provides methods for the forward dropout layer in the batch processing mode.
Definition: dropout_layer_forward.h:102
daal::algorithms::neural_networks::layers::dropout::forward::interface1::Batch::Batch
Batch(ParameterType ¶meter)
Definition: dropout_layer_forward.h:125
daal::algorithms::neural_networks::layers::dropout::forward::interface1::BatchContainer
Provides methods to run implementations of the of the forward dropout layer This class is associated ...
Definition: dropout_layer_forward.h:62
daal::algorithms::neural_networks::layers::dropout::forward::interface1::Batch::getResult
ResultPtr getResult()
Definition: dropout_layer_forward.h:173
daal::algorithms::neural_networks::layers::dropout::forward::interface1::Batch::parameter
ParameterType & parameter
Definition: dropout_layer_forward.h:111
daal::algorithms::neural_networks::layers::dropout::forward::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: dropout_layer_forward.h:136
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::layers::dropout::forward::interface1::Batch::getLayerResult
layers::forward::ResultPtr getLayerResult() DAAL_C11_OVERRIDE
Definition: dropout_layer_forward.h:164
daal::algorithms::neural_networks::layers::dropout::forward::interface1::Batch::getLayerParameter
virtual ParameterType * getLayerParameter() DAAL_C11_OVERRIDE
Definition: dropout_layer_forward.h:158
daal::algorithms::neural_networks::layers::dropout::forward::interface1::Batch::allocateResult
virtual services::Status allocateResult() DAAL_C11_OVERRIDE
Definition: dropout_layer_forward.h:208
daal::services::ErrorNullResult
Definition: error_indexes.h:96
daal::algorithms::neural_networks::layers::dropout::forward::interface1::Batch::Batch
Batch()
Definition: dropout_layer_forward.h:115