48 #ifndef __SMOOTHRELU_LAYER_FORWARD_H__
49 #define __SMOOTHRELU_LAYER_FORWARD_H__
51 #include "algorithms/algorithm.h"
52 #include "data_management/data/tensor.h"
53 #include "services/daal_defines.h"
54 #include "algorithms/neural_networks/layers/layer.h"
55 #include "algorithms/neural_networks/layers/smoothrelu/smoothrelu_layer_types.h"
56 #include "algorithms/neural_networks/layers/smoothrelu/smoothrelu_layer_forward_types.h"
62 namespace neural_networks
87 template<
typename algorithmFPType, Method method, CpuType cpu>
88 class DAAL_EXPORT BatchContainer :
public layers::forward::LayerContainerIfaceImpl
96 BatchContainer(daal::services::Environment::env *daalEnv);
104 services::Status compute() DAAL_C11_OVERRIDE;
125 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
126 class Batch :
public layers::forward::LayerIfaceImpl
129 typedef layers::forward::LayerIfaceImpl super;
130 Parameter ¶meter;
134 Batch() : parameter(_defaultParameter)
144 Batch(Parameter& parameter) : parameter(parameter), _defaultParameter(parameter)
155 Batch(
const Batch<algorithmFPType, method> &other) : super(other),
156 _defaultParameter(other.parameter), parameter(_defaultParameter), input(other.input)
165 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
171 virtual Input *getLayerInput() DAAL_C11_OVERRIDE {
return &input; }
177 virtual Parameter *getLayerParameter() DAAL_C11_OVERRIDE {
return ¶meter; };
183 layers::forward::ResultPtr getLayerResult() DAAL_C11_OVERRIDE
192 ResultPtr getResult()
203 services::Status setResult(
const ResultPtr& result)
205 DAAL_CHECK(result, services::ErrorNullResult)
207 _res = _result.get();
208 return services::Status();
217 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
219 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
227 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
229 services::Status s = this->_result->template allocate<algorithmFPType>(&(this->input), ¶meter, (
int) method);
230 this->_res = this->_result.get();
235 virtual Batch<algorithmFPType, method> *cloneImpl() const DAAL_C11_OVERRIDE
237 return new Batch<algorithmFPType, method>(*this);
242 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_LAYER_CONTAINER(BatchContainer, algorithmFPType, method)(&_env);
245 _result.reset(
new Result());
250 Parameter _defaultParameter;
254 using interface1::BatchContainer;
255 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:88
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:126
daal
Definition: algorithm_base_common.h:57
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::Batch
Batch(Parameter ¶meter)
Definition: smoothrelu_layer_forward.h:144
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::allocateResult
virtual services::Status allocateResult() DAAL_C11_OVERRIDE
Definition: smoothrelu_layer_forward.h:227
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: smoothrelu_layer_forward.h:155
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::getLayerParameter
virtual Parameter * getLayerParameter() DAAL_C11_OVERRIDE
Definition: smoothrelu_layer_forward.h:177
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::Batch
Batch()
Definition: smoothrelu_layer_forward.h:134
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: smoothrelu_layer_forward.h:217
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: smoothrelu_layer_forward.h:165
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::getLayerResult
layers::forward::ResultPtr getLayerResult() DAAL_C11_OVERRIDE
Definition: smoothrelu_layer_forward.h:183
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::input
Input input
Definition: smoothrelu_layer_forward.h:131
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::getResult
ResultPtr getResult()
Definition: smoothrelu_layer_forward.h:192
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::parameter
Parameter & parameter
Definition: smoothrelu_layer_forward.h:130
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: smoothrelu_layer_forward.h:203
daal::algorithms::neural_networks::layers::smoothrelu::forward::interface1::Batch::getLayerInput
virtual Input * getLayerInput() DAAL_C11_OVERRIDE
Definition: smoothrelu_layer_forward.h:171
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:94
daal::services::ErrorNullResult
Definition: error_indexes.h:122