22 #ifndef __SMOOTHRELU_LAYER_FORWARD_H__
23 #define __SMOOTHRELU_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/smoothrelu/smoothrelu_layer_types.h"
30 #include "algorithms/neural_networks/layers/smoothrelu/smoothrelu_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;
99 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
100 class Batch :
public layers::forward::LayerIfaceImpl
103 typedef layers::forward::LayerIfaceImpl super;
105 typedef algorithms::neural_networks::layers::smoothrelu::forward::Input InputType;
106 typedef algorithms::neural_networks::layers::smoothrelu::Parameter ParameterType;
107 typedef algorithms::neural_networks::layers::smoothrelu::forward::Result ResultType;
109 ParameterType ¶meter;
113 Batch() : parameter(_defaultParameter)
123 Batch(ParameterType& parameter) : parameter(parameter), _defaultParameter(parameter)
134 Batch(
const Batch<algorithmFPType, method> &other) : super(other),
135 _defaultParameter(other.parameter), parameter(_defaultParameter), input(other.input)
144 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
150 virtual InputType *getLayerInput() DAAL_C11_OVERRIDE {
return &input; }
156 virtual ParameterType *getLayerParameter() DAAL_C11_OVERRIDE {
return ¶meter; };
162 layers::forward::ResultPtr getLayerResult() DAAL_C11_OVERRIDE
171 ResultPtr getResult()
182 services::Status setResult(
const ResultPtr& result)
184 DAAL_CHECK(result, services::ErrorNullResult)
186 _res = _result.get();
187 return services::Status();
196 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
198 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
206 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
208 services::Status s = this->_result->template allocate<algorithmFPType>(&(this->input), ¶meter, (
int) method);
209 this->_res = this->_result.get();
214 virtual Batch<algorithmFPType, method> *cloneImpl() const DAAL_C11_OVERRIDE
216 return new Batch<algorithmFPType, method>(*this);
221 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_LAYER_CONTAINER(BatchContainer, algorithmFPType, method)(&_env);
224 _result.reset(
new ResultType());
229 ParameterType _defaultParameter;
233 using interface1::BatchContainer;
234 using interface1::Batch;
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::BatchContainer
Provides methods to run implementations of the forward smooth relu layer This class is associated wit...
Definition: smoothrelu_layer_forward.h:62
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch
Provides methods for the forward smooth relu layer in the batch processing mode.
Definition: smoothrelu_layer_forward.h:100
daal
Definition: algorithm_base_common.h:31
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::allocateResult
virtual services::Status allocateResult() DAAL_C11_OVERRIDE
Definition: smoothrelu_layer_forward.h:206
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: smoothrelu_layer_forward.h:134
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::getLayerParameter
virtual ParameterType * getLayerParameter() DAAL_C11_OVERRIDE
Definition: smoothrelu_layer_forward.h:156
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::Batch
Batch()
Definition: smoothrelu_layer_forward.h:113
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::parameter
ParameterType & parameter
Definition: smoothrelu_layer_forward.h:109
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::input
InputType input
Definition: smoothrelu_layer_forward.h:110
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: smoothrelu_layer_forward.h:196
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: smoothrelu_layer_forward.h:144
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::getLayerResult
layers::forward::ResultPtr getLayerResult() DAAL_C11_OVERRIDE
Definition: smoothrelu_layer_forward.h:162
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::getResult
ResultPtr getResult()
Definition: smoothrelu_layer_forward.h:171
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: smoothrelu_layer_forward.h:182
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::smoothrelu::forward::interface1::Batch::getLayerInput
virtual InputType * getLayerInput() DAAL_C11_OVERRIDE
Definition: smoothrelu_layer_forward.h:150
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::Batch
Batch(ParameterType ¶meter)
Definition: smoothrelu_layer_forward.h:123
daal::services::ErrorNullResult
Definition: error_indexes.h:96