23 #ifndef __SOFTMAX_LAYER_FORWARD_H__
24 #define __SOFTMAX_LAYER_FORWARD_H__
26 #include "algorithms/algorithm.h"
27 #include "data_management/data/tensor.h"
28 #include "services/daal_defines.h"
29 #include "algorithms/neural_networks/layers/layer.h"
30 #include "algorithms/neural_networks/layers/softmax/softmax_layer_types.h"
31 #include "algorithms/neural_networks/layers/softmax/softmax_layer_forward_types.h"
37 namespace neural_networks
56 template<
typename algorithmFPType, Method method, CpuType cpu>
57 class DAAL_EXPORT BatchContainer :
public layers::forward::LayerContainerIfaceImpl
65 BatchContainer(daal::services::Environment::env *daalEnv);
73 services::Status compute() DAAL_C11_OVERRIDE;
92 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
93 class Batch :
public layers::forward::LayerIfaceImpl
96 typedef layers::forward::LayerIfaceImpl super;
98 typedef algorithms::neural_networks::layers::softmax::forward::Input InputType;
99 typedef algorithms::neural_networks::layers::softmax::Parameter ParameterType;
100 typedef algorithms::neural_networks::layers::softmax::forward::Result ResultType;
102 ParameterType ¶meter;
106 Batch() : parameter(_defaultParameter)
116 Batch(ParameterType& parameter) : parameter(parameter), _defaultParameter(parameter)
127 Batch(
const Batch<algorithmFPType, method> &other) : super(other),
128 _defaultParameter(other.parameter), parameter(_defaultParameter), input(other.input)
137 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
143 virtual InputType *getLayerInput() DAAL_C11_OVERRIDE {
return &input; }
149 virtual ParameterType *getLayerParameter() DAAL_C11_OVERRIDE {
return ¶meter; };
155 layers::forward::ResultPtr getLayerResult() DAAL_C11_OVERRIDE
164 ResultPtr getResult()
175 services::Status setResult(
const ResultPtr& result)
177 DAAL_CHECK(result, services::ErrorNullResult)
179 _res = _result.get();
180 return services::Status();
189 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
191 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
199 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
201 services::Status s = this->_result->template allocate<algorithmFPType>(&(this->input), ¶meter, (
int) method);
202 this->_res = this->_result.get();
207 virtual Batch<algorithmFPType, method> *cloneImpl() const DAAL_C11_OVERRIDE
209 return new Batch<algorithmFPType, method>(*this);
214 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_LAYER_CONTAINER(BatchContainer, algorithmFPType, method)(&_env);
217 _result.reset(
new ResultType());
222 ParameterType _defaultParameter;
226 using interface1::BatchContainer;
227 using interface1::Batch;
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch::Batch
Batch()
Definition: softmax_layer_forward.h:106
daal
Definition: algorithm_base_common.h:31
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: softmax_layer_forward.h:137
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch::allocateResult
virtual services::Status allocateResult() DAAL_C11_OVERRIDE
Definition: softmax_layer_forward.h:199
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch::Batch
Batch(ParameterType ¶meter)
Definition: softmax_layer_forward.h:116
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch::getResult
ResultPtr getResult()
Definition: softmax_layer_forward.h:164
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch::getLayerInput
virtual InputType * getLayerInput() DAAL_C11_OVERRIDE
Definition: softmax_layer_forward.h:143
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch::getLayerParameter
virtual ParameterType * getLayerParameter() DAAL_C11_OVERRIDE
Definition: softmax_layer_forward.h:149
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: softmax_layer_forward.h:175
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: softmax_layer_forward.h:189
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch
Computes the results of the forward softmax layer in the batch processing mode.
Definition: softmax_layer_forward.h:93
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch::parameter
ParameterType & parameter
Definition: softmax_layer_forward.h:102
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::softmax::forward::interface1::Batch::getLayerResult
layers::forward::ResultPtr getLayerResult() DAAL_C11_OVERRIDE
Definition: softmax_layer_forward.h:155
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: softmax_layer_forward.h:127
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch::input
InputType input
Definition: softmax_layer_forward.h:103
daal::algorithms::neural_networks::layers::softmax::forward::interface1::BatchContainer
Class containing methods for the forward softmax layer using algorithmFPType precision arithmetic...
Definition: softmax_layer_forward.h:57
daal::services::ErrorNullResult
Definition: error_indexes.h:96