25 #ifndef __SOFTMAX_LAYER_FORWARD_H__
26 #define __SOFTMAX_LAYER_FORWARD_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_forward_types.h"
39 namespace neural_networks
59 template<
typename algorithmFPType, Method method, CpuType cpu>
60 class BatchContainer :
public layers::forward::LayerContainerIfaceImpl
69 DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv);
74 DAAL_DEPRECATED ~BatchContainer();
80 services::Status compute() DAAL_C11_OVERRIDE;
101 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
102 class Batch :
public layers::forward::LayerIfaceImpl
105 typedef layers::forward::LayerIfaceImpl super;
107 typedef algorithms::neural_networks::layers::softmax::forward::Input InputType;
108 typedef algorithms::neural_networks::layers::softmax::Parameter ParameterType;
109 typedef algorithms::neural_networks::layers::softmax::forward::Result ResultType;
111 ParameterType ¶meter;
118 Batch() : parameter(_defaultParameter)
129 DAAL_DEPRECATED Batch(ParameterType& parameter) : parameter(parameter), _defaultParameter(parameter)
141 Batch(
const Batch<algorithmFPType, method> &other) : super(other),
142 _defaultParameter(other.parameter), parameter(_defaultParameter), input(other.input)
151 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
157 virtual InputType *getLayerInput() DAAL_C11_OVERRIDE {
return &input; }
163 virtual ParameterType *getLayerParameter() DAAL_C11_OVERRIDE {
return ¶meter; };
169 layers::forward::ResultPtr getLayerResult() DAAL_C11_OVERRIDE
178 ResultPtr getResult()
189 services::Status setResult(
const ResultPtr& result)
191 DAAL_CHECK(result, services::ErrorNullResult)
193 _res = _result.get();
194 return services::Status();
203 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
205 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
213 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
215 services::Status s = this->_result->template allocate<algorithmFPType>(&(this->input), ¶meter, (
int) method);
216 this->_res = this->_result.get();
221 virtual Batch<algorithmFPType, method> *cloneImpl() const DAAL_C11_OVERRIDE
223 return new Batch<algorithmFPType, method>(*this);
228 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_LAYER_CONTAINER(BatchContainer, algorithmFPType, method)(&_env);
231 _result.reset(
new ResultType());
236 ParameterType _defaultParameter;
240 using interface1::BatchContainer;
241 using interface1::Batch;
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:60
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch::getLayerInput
virtual InputType * getLayerInput() DAAL_C11_OVERRIDE
Definition: softmax_layer_forward.h:157
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch::Batch
Batch()
Definition: softmax_layer_forward.h:118
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: softmax_layer_forward.h:151
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch::input
InputType input
Definition: softmax_layer_forward.h:112
daal::algorithms::neural_networks::layers::softmax::forward::interface1::BatchContainer::~BatchContainer
DAAL_DEPRECATED ~BatchContainer()
daal::services::ErrorNullResult
Definition: error_indexes.h:98
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: softmax_layer_forward.h:203
daal::algorithms::neural_networks::layers::softmax::forward::interface1::BatchContainer::BatchContainer
DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch::getLayerParameter
virtual ParameterType * getLayerParameter() DAAL_C11_OVERRIDE
Definition: softmax_layer_forward.h:163
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: softmax_layer_forward.h:141
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch::getLayerResult
layers::forward::ResultPtr getLayerResult() DAAL_C11_OVERRIDE
Definition: softmax_layer_forward.h:169
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:102
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch::Batch
DAAL_DEPRECATED Batch(ParameterType ¶meter)
Definition: softmax_layer_forward.h:129
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch::parameter
ParameterType & parameter
Definition: softmax_layer_forward.h:111
daal::algorithms::neural_networks::layers::softmax::forward::interface1::BatchContainer::compute
services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: softmax_layer_forward.h:189
daal::algorithms::neural_networks::layers::softmax::forward::interface1::Batch::allocateResult
virtual services::Status allocateResult() DAAL_C11_OVERRIDE
Definition: softmax_layer_forward.h:213
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::forward::interface1::Batch::getResult
ResultPtr getResult()
Definition: softmax_layer_forward.h:178