49 #ifndef __TANH_LAYER_FORWARD_H__
50 #define __TANH_LAYER_FORWARD_H__
52 #include "algorithms/algorithm.h"
53 #include "data_management/data/tensor.h"
54 #include "services/daal_defines.h"
55 #include "algorithms/neural_networks/layers/layer.h"
56 #include "algorithms/neural_networks/layers/tanh/tanh_layer_forward_types.h"
62 namespace neural_networks
93 template<
typename algorithmFPType, Method method, CpuType cpu>
94 class DAAL_EXPORT BatchContainer :
public layers::forward::LayerContainerIfaceImpl
102 BatchContainer(daal::services::Environment::env *daalEnv);
110 services::Status compute() DAAL_C11_OVERRIDE;
131 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
132 class Batch :
public layers::forward::LayerIfaceImpl
135 typedef layers::forward::LayerIfaceImpl super;
136 Parameter ¶meter;
140 Batch() : parameter(_defaultParameter)
150 Batch(Parameter& parameter) : parameter(parameter), _defaultParameter(parameter)
161 Batch(
const Batch<algorithmFPType, method> &other) : super(other),
162 _defaultParameter(other.parameter), parameter(_defaultParameter), input(other.input)
171 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
177 virtual Input *getLayerInput() DAAL_C11_OVERRIDE {
return &input; }
183 virtual Parameter *getLayerParameter() DAAL_C11_OVERRIDE {
return ¶meter; };
189 layers::forward::ResultPtr getLayerResult() DAAL_C11_OVERRIDE
198 ResultPtr getResult()
209 services::Status setResult(
const ResultPtr& result)
211 DAAL_CHECK(result, services::ErrorNullResult)
213 _res = _result.get();
214 return services::Status();
222 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
224 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
232 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
234 services::Status s = this->_result->template allocate<algorithmFPType>(&(this->input), ¶meter, (
int) method);
235 this->_res = this->_result.get();
240 virtual Batch<algorithmFPType, method> *cloneImpl() const DAAL_C11_OVERRIDE
242 return new Batch<algorithmFPType, method>(*this);
247 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_LAYER_CONTAINER(BatchContainer, algorithmFPType, method)(&_env);
250 _result.reset(
new Result());
255 Parameter _defaultParameter;
259 using interface1::BatchContainer;
260 using interface1::Batch;
daal::algorithms::neural_networks::layers::tanh::forward::interface1::BatchContainer
Provides methods to run implementations of the of the forward tanh layer This class is associated wit...
Definition: tanh_layer_forward.h:94
daal
Definition: algorithm_base_common.h:57
daal::algorithms::neural_networks::layers::tanh::forward::interface1::Batch::getLayerParameter
virtual Parameter * getLayerParameter() DAAL_C11_OVERRIDE
Definition: tanh_layer_forward.h:183
daal::algorithms::neural_networks::layers::tanh::forward::interface1::Batch
Computes the results of the forward hyperbolic tangent in the batch processing mode.
Definition: tanh_layer_forward.h:132
daal::algorithms::neural_networks::layers::tanh::forward::interface1::Batch::parameter
Parameter & parameter
Definition: tanh_layer_forward.h:136
daal::algorithms::neural_networks::layers::tanh::forward::interface1::Batch::getResult
ResultPtr getResult()
Definition: tanh_layer_forward.h:198
daal::algorithms::neural_networks::layers::tanh::forward::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: tanh_layer_forward.h:171
daal::algorithms::neural_networks::layers::tanh::forward::interface1::Batch::getLayerResult
layers::forward::ResultPtr getLayerResult() DAAL_C11_OVERRIDE
Definition: tanh_layer_forward.h:189
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::layers::tanh::forward::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: tanh_layer_forward.h:161
daal::algorithms::neural_networks::layers::tanh::forward::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: tanh_layer_forward.h:222
daal::algorithms::neural_networks::layers::tanh::forward::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: tanh_layer_forward.h:209
daal::algorithms::neural_networks::layers::tanh::forward::interface1::Batch::Batch
Batch(Parameter ¶meter)
Definition: tanh_layer_forward.h:150
daal::algorithms::neural_networks::layers::tanh::forward::interface1::Batch::allocateResult
virtual services::Status allocateResult() DAAL_C11_OVERRIDE
Definition: tanh_layer_forward.h:232
daal::services::ErrorNullResult
Definition: error_indexes.h:122
daal::algorithms::neural_networks::layers::tanh::forward::interface1::Batch::input
Input input
Definition: tanh_layer_forward.h:137
daal::algorithms::neural_networks::layers::tanh::forward::interface1::Batch::Batch
Batch()
Definition: tanh_layer_forward.h:140
daal::algorithms::neural_networks::layers::tanh::forward::interface1::Batch::getLayerInput
virtual Input * getLayerInput() DAAL_C11_OVERRIDE
Definition: tanh_layer_forward.h:177