25 #ifndef __PRELU_LAYER_FORWARD_H__
26 #define __PRELU_LAYER_FORWARD_H__
28 #include "algorithms/algorithm.h"
29 #include "data_management/data/tensor.h"
30 #include "services/daal_defines.h"
31 #include "algorithms/neural_networks/layers/layer.h"
32 #include "algorithms/neural_networks/layers/prelu/prelu_layer_types.h"
33 #include "algorithms/neural_networks/layers/prelu/prelu_layer_forward_types.h"
39 namespace neural_networks
69 template<
typename algorithmFPType, Method method, CpuType cpu>
70 class BatchContainer :
public layers::forward::LayerContainerIfaceImpl
79 DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv);
84 DAAL_DEPRECATED ~BatchContainer();
91 DAAL_DEPRECATED services::Status compute() DAAL_C11_OVERRIDE;
95 DAAL_DEPRECATED services::Status setupCompute() DAAL_C11_OVERRIDE;
99 DAAL_DEPRECATED_VIRTUAL
virtual services::Status allocateInput() DAAL_C11_OVERRIDE
101 Input *input =
static_cast<Input *
>(_in);
102 return input->allocate<algorithmFPType>(_par, (int) method);
126 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
127 class Batch :
public layers::forward::LayerIfaceImpl
130 typedef layers::forward::LayerIfaceImpl super;
132 typedef algorithms::neural_networks::layers::prelu::forward::Input InputType;
133 typedef algorithms::neural_networks::layers::prelu::Parameter ParameterType;
134 typedef algorithms::neural_networks::layers::prelu::forward::Result ResultType;
136 ParameterType ¶meter;
143 DAAL_DEPRECATED Batch() : parameter(_defaultParameter)
154 DAAL_DEPRECATED Batch(ParameterType& parameter) : parameter(parameter), _defaultParameter(parameter)
166 Batch(
const Batch<algorithmFPType, method> &other) : super(other),
167 _defaultParameter(other.parameter), parameter(_defaultParameter), input(other.input)
177 DAAL_DEPRECATED_VIRTUAL
virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
184 DAAL_DEPRECATED_VIRTUAL
virtual InputType *getLayerInput() DAAL_C11_OVERRIDE {
return &input; }
191 DAAL_DEPRECATED_VIRTUAL
virtual ParameterType *getLayerParameter() DAAL_C11_OVERRIDE {
return ¶meter; };
198 DAAL_DEPRECATED layers::forward::ResultPtr getLayerResult() DAAL_C11_OVERRIDE
208 DAAL_DEPRECATED ResultPtr getResult()
220 DAAL_DEPRECATED services::Status setResult(
const ResultPtr& result)
222 DAAL_CHECK(result, services::ErrorNullResult)
224 _res = _result.get();
225 return services::Status();
234 DAAL_DEPRECATED services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
236 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
245 DAAL_DEPRECATED_VIRTUAL
virtual services::Status allocateResult() DAAL_C11_OVERRIDE
247 services::Status s = this->_result->template allocate<algorithmFPType>(&(this->input), ¶meter, (
int) method);
248 this->_res = this->_result.get();
256 DAAL_DEPRECATED_VIRTUAL
virtual Batch<algorithmFPType, method> *cloneImpl() const DAAL_C11_OVERRIDE
258 return new Batch<algorithmFPType, method>(*this);
266 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_LAYER_CONTAINER(BatchContainer, algorithmFPType, method)(&_env);
269 _result.reset(
new ResultType());
274 ParameterType _defaultParameter;
278 using interface1::BatchContainer;
279 using interface1::Batch;
daal::algorithms::neural_networks::layers::prelu::forward::interface1::Batch::getLayerInput
virtual DAAL_DEPRECATED_VIRTUAL InputType * getLayerInput() DAAL_C11_OVERRIDE
Definition: prelu_layer_forward.h:184
daal::algorithms::neural_networks::layers::prelu::forward::interface1::Batch::allocateResult
virtual DAAL_DEPRECATED_VIRTUAL services::Status allocateResult() DAAL_C11_OVERRIDE
Definition: prelu_layer_forward.h:245
daal::algorithms::neural_networks::layers::prelu::forward::interface1::BatchContainer::~BatchContainer
DAAL_DEPRECATED ~BatchContainer()
daal::algorithms::neural_networks::layers::prelu::forward::interface1::Batch::getLayerResult
DAAL_DEPRECATED layers::forward::ResultPtr getLayerResult() DAAL_C11_OVERRIDE
Definition: prelu_layer_forward.h:198
daal::algorithms::neural_networks::layers::prelu::forward::interface1::Batch::getLayerParameter
virtual DAAL_DEPRECATED_VIRTUAL ParameterType * getLayerParameter() DAAL_C11_OVERRIDE
Definition: prelu_layer_forward.h:191
daal::algorithms::neural_networks::layers::prelu::forward::interface1::Batch::Batch
DAAL_DEPRECATED Batch(ParameterType ¶meter)
Definition: prelu_layer_forward.h:154
daal::algorithms::neural_networks::layers::prelu::forward::interface1::Batch::parameter
ParameterType & parameter
Definition: prelu_layer_forward.h:136
daal::algorithms::neural_networks::layers::prelu::forward::interface1::BatchContainer
Provides methods to run implementations of the of the forward prelu layer This class is associated wi...
Definition: prelu_layer_forward.h:70
daal::services::ErrorNullResult
Definition: error_indexes.h:98
daal::algorithms::neural_networks::layers::prelu::forward::interface1::Batch::getResult
DAAL_DEPRECATED ResultPtr getResult()
Definition: prelu_layer_forward.h:208
daal::algorithms::neural_networks::layers::prelu::forward::interface1::BatchContainer::BatchContainer
DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::neural_networks::layers::prelu::forward::interface1::Batch::Batch
DAAL_DEPRECATED Batch()
Default constructor.
Definition: prelu_layer_forward.h:143
daal::algorithms::neural_networks::layers::prelu::forward::interface1::Batch::input
InputType input
Definition: prelu_layer_forward.h:137
daal::algorithms::neural_networks::layers::prelu::forward::interface1::BatchContainer::compute
DAAL_DEPRECATED services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::neural_networks::layers::prelu::forward::interface1::Batch::setResult
DAAL_DEPRECATED services::Status setResult(const ResultPtr &result)
Definition: prelu_layer_forward.h:220
daal::algorithms::neural_networks::layers::prelu::forward::interface1::Input::allocate
DAAL_EXPORT services::Status allocate(const daal::algorithms::Parameter *par, const int method)
daal::algorithms::neural_networks::layers::prelu::forward::interface1::Batch::getMethod
virtual DAAL_DEPRECATED_VIRTUAL int getMethod() const DAAL_C11_OVERRIDE
Definition: prelu_layer_forward.h:177
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:70
daal::algorithms::neural_networks::layers::prelu::forward::interface1::Batch
Computes the results of the forward prelu layer in the batch processing mode.
Definition: prelu_layer_forward.h:127
daal::algorithms::neural_networks::layers::prelu::forward::interface1::Input
Input objects for the forward prelu layer
Definition: prelu_layer_forward_types.h:68
daal::algorithms::neural_networks::layers::prelu::forward::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: prelu_layer_forward.h:166
daal::algorithms::neural_networks::layers::prelu::forward::interface1::Batch::clone
DAAL_DEPRECATED services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: prelu_layer_forward.h:234