25 #ifndef __TANH_LAYER_BACKWARD_H__
26 #define __TANH_LAYER_BACKWARD_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/tanh/tanh_layer_types.h"
33 #include "algorithms/neural_networks/layers/tanh/tanh_layer_backward_types.h"
39 namespace neural_networks
72 template<
typename algorithmFPType, Method method, CpuType cpu>
73 class BatchContainer :
public AnalysisContainerIface<batch>
82 DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv);
87 DAAL_DEPRECATED ~BatchContainer();
93 services::Status compute() DAAL_C11_OVERRIDE;
115 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
116 class Batch :
public layers::backward::LayerIfaceImpl
119 typedef layers::backward::LayerIfaceImpl super;
121 typedef algorithms::neural_networks::layers::tanh::backward::Input InputType;
122 typedef algorithms::neural_networks::layers::tanh::Parameter ParameterType;
123 typedef algorithms::neural_networks::layers::tanh::backward::Result ResultType;
125 ParameterType ¶meter;
132 DAAL_DEPRECATED Batch() : parameter(_defaultParameter)
143 DAAL_DEPRECATED 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 InputType *getLayerInput() DAAL_C11_OVERRIDE {
return &input; }
177 virtual ParameterType *getLayerParameter() DAAL_C11_OVERRIDE {
return ¶meter; };
183 layers::backward::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();
216 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
218 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
226 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
228 services::Status s = this->_result->template allocate<algorithmFPType>(&(this->input), ¶meter, (
int) method);
229 this->_res = this->_result.get();
234 virtual Batch<algorithmFPType, method> *cloneImpl() const DAAL_C11_OVERRIDE
236 return new Batch<algorithmFPType, method>(*this);
241 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
244 _result.reset(
new ResultType());
249 ParameterType _defaultParameter;
253 using interface1::BatchContainer;
254 using interface1::Batch;
daal::algorithms::neural_networks::layers::tanh::backward::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: tanh_layer_backward.h:165
daal::batch
Definition: daal_defines.h:112
daal::algorithms::neural_networks::layers::tanh::backward::interface1::BatchContainer
Provides methods to run implementations of the of the backward tanh layer This class is associated wi...
Definition: tanh_layer_backward.h:73
daal::algorithms::neural_networks::layers::tanh::backward::interface1::Batch::getLayerInput
virtual InputType * getLayerInput() DAAL_C11_OVERRIDE
Definition: tanh_layer_backward.h:171
daal::algorithms::neural_networks::layers::tanh::backward::interface1::Batch::getLayerResult
layers::backward::ResultPtr getLayerResult() DAAL_C11_OVERRIDE
Definition: tanh_layer_backward.h:183
daal::services::ErrorNullResult
Definition: error_indexes.h:98
daal::algorithms::AnalysisContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the analy...
Definition: analysis.h:55
daal::algorithms::neural_networks::layers::tanh::backward::interface1::Batch::Batch
DAAL_DEPRECATED Batch()
Definition: tanh_layer_backward.h:132
daal::algorithms::neural_networks::layers::tanh::backward::interface1::Batch::input
InputType input
Definition: tanh_layer_backward.h:126
daal::algorithms::neural_networks::layers::tanh::backward::interface1::BatchContainer::compute
services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::neural_networks::layers::tanh::backward::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: tanh_layer_backward.h:216
daal::algorithms::neural_networks::layers::tanh::backward::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: tanh_layer_backward.h:203
daal::algorithms::neural_networks::layers::tanh::backward::interface1::Batch::parameter
ParameterType & parameter
Definition: tanh_layer_backward.h:125
daal::algorithms::neural_networks::layers::tanh::backward::interface1::Batch
Computes the results of the backward hyperbolic tangent in the batch processing mode.
Definition: tanh_layer_backward.h:116
daal::algorithms::neural_networks::layers::tanh::backward::interface1::Batch::getLayerParameter
virtual ParameterType * getLayerParameter() DAAL_C11_OVERRIDE
Definition: tanh_layer_backward.h:177
daal::algorithms::neural_networks::layers::tanh::backward::interface1::BatchContainer::~BatchContainer
DAAL_DEPRECATED ~BatchContainer()
daal::algorithms::neural_networks::layers::tanh::backward::interface1::Batch::getResult
ResultPtr getResult()
Definition: tanh_layer_backward.h:192
daal::algorithms::neural_networks::layers::tanh::backward::interface1::Batch::allocateResult
virtual services::Status allocateResult() DAAL_C11_OVERRIDE
Definition: tanh_layer_backward.h:226
daal::algorithms::neural_networks::layers::tanh::backward::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: tanh_layer_backward.h:155
daal::algorithms::neural_networks::layers::tanh::backward::interface1::BatchContainer::BatchContainer
DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv)
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::tanh::backward::interface1::Batch::Batch
DAAL_DEPRECATED Batch(Parameter ¶meter)
Definition: tanh_layer_backward.h:143