25 #ifndef __SOFTMAX_LAYER_BACKWARD_H__
26 #define __SOFTMAX_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/softmax/softmax_layer_types.h"
33 #include "algorithms/neural_networks/layers/softmax/softmax_layer_backward_types.h"
39 namespace neural_networks
59 template<
typename algorithmFPType, Method method, CpuType cpu>
60 class BatchContainer :
public daal::algorithms::AnalysisContainerIface<batch>
69 DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv);
74 DAAL_DEPRECATED ~BatchContainer();
80 services::Status compute() DAAL_C11_OVERRIDE;
102 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
103 class Batch :
public layers::backward::LayerIfaceImpl
106 typedef layers::backward::LayerIfaceImpl super;
108 typedef algorithms::neural_networks::layers::softmax::backward::Input InputType;
109 typedef algorithms::neural_networks::layers::softmax::Parameter ParameterType;
110 typedef algorithms::neural_networks::layers::softmax::backward::Result ResultType;
112 ParameterType ¶meter;
119 DAAL_DEPRECATED Batch() : parameter(_defaultParameter)
130 DAAL_DEPRECATED Batch(ParameterType& parameter) : parameter(parameter), _defaultParameter(parameter)
142 Batch(
const Batch<algorithmFPType, method> &other) : super(other),
143 _defaultParameter(other.parameter), parameter(_defaultParameter), input(other.input)
152 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
158 virtual InputType *getLayerInput() DAAL_C11_OVERRIDE {
return &input; }
164 virtual ParameterType *getLayerParameter() DAAL_C11_OVERRIDE {
return ¶meter; };
170 layers::backward::ResultPtr getLayerResult() DAAL_C11_OVERRIDE
179 ResultPtr getResult()
190 services::Status setResult(
const ResultPtr& result)
192 DAAL_CHECK(result, services::ErrorNullResult)
194 _res = _result.get();
195 return services::Status();
204 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
206 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
214 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
216 services::Status s = this->_result->template allocate<algorithmFPType>(&(this->input), ¶meter, (
int) method);
217 this->_res = this->_result.get();
222 virtual Batch<algorithmFPType, method> *cloneImpl() const DAAL_C11_OVERRIDE
224 return new Batch<algorithmFPType, method>(*this);
229 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
232 _result.reset(
new ResultType());
237 ParameterType _defaultParameter;
241 using interface1::BatchContainer;
242 using interface1::Batch;
daal::algorithms::neural_networks::layers::softmax::backward::interface1::Batch::getLayerInput
virtual InputType * getLayerInput() DAAL_C11_OVERRIDE
Definition: softmax_layer_backward.h:158
daal::batch
Definition: daal_defines.h:112
daal::algorithms::neural_networks::layers::softmax::backward::interface1::BatchContainer
Class containing methods for the backward softmax layer using algorithmFPType precision arithmetic...
Definition: softmax_layer_backward.h:60
daal::algorithms::neural_networks::layers::softmax::backward::interface1::Batch
Computes the results of the backward softmax layer in the batch processing mode.
Definition: softmax_layer_backward.h:103
daal::algorithms::neural_networks::layers::softmax::backward::interface1::Batch::Batch
DAAL_DEPRECATED Batch()
Definition: softmax_layer_backward.h:119
daal::algorithms::neural_networks::layers::softmax::backward::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: softmax_layer_backward.h:152
daal::algorithms::neural_networks::layers::softmax::backward::interface1::Batch::input
InputType input
Definition: softmax_layer_backward.h:113
daal::algorithms::neural_networks::layers::softmax::backward::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: softmax_layer_backward.h:204
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::softmax::backward::interface1::BatchContainer::BatchContainer
DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::neural_networks::layers::softmax::backward::interface1::Batch::getLayerResult
layers::backward::ResultPtr getLayerResult() DAAL_C11_OVERRIDE
Definition: softmax_layer_backward.h:170
daal::algorithms::neural_networks::layers::softmax::backward::interface1::Batch::getLayerParameter
virtual ParameterType * getLayerParameter() DAAL_C11_OVERRIDE
Definition: softmax_layer_backward.h:164
daal::algorithms::neural_networks::layers::softmax::backward::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: softmax_layer_backward.h:142
daal::algorithms::neural_networks::layers::softmax::backward::interface1::BatchContainer::~BatchContainer
DAAL_DEPRECATED ~BatchContainer()
daal::algorithms::neural_networks::layers::softmax::backward::interface1::Batch::parameter
ParameterType & parameter
Definition: softmax_layer_backward.h:112
daal::algorithms::neural_networks::layers::softmax::backward::interface1::Batch::Batch
DAAL_DEPRECATED Batch(ParameterType ¶meter)
Definition: softmax_layer_backward.h:130
daal::algorithms::neural_networks::layers::softmax::backward::interface1::Batch::allocateResult
virtual services::Status allocateResult() DAAL_C11_OVERRIDE
Definition: softmax_layer_backward.h:214
daal::algorithms::neural_networks::layers::softmax::backward::interface1::BatchContainer::compute
services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::neural_networks::layers::softmax::backward::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: softmax_layer_backward.h:190
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::softmax::backward::interface1::Batch::getResult
ResultPtr getResult()
Definition: softmax_layer_backward.h:179