25 #ifndef __FULLYCONNECTED_LAYER_FORWARD_H__
26 #define __FULLYCONNECTED_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/fullyconnected/fullyconnected_layer_types.h"
33 #include "algorithms/neural_networks/layers/fullyconnected/fullyconnected_layer_forward_types.h"
39 namespace neural_networks
43 namespace fullyconnected
66 template<
typename algorithmFPType, Method method, CpuType cpu>
67 class BatchContainer :
public layers::forward::LayerContainerIfaceImpl
76 DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv);
81 DAAL_DEPRECATED ~BatchContainer();
88 DAAL_DEPRECATED services::Status compute() DAAL_C11_OVERRIDE;
92 DAAL_DEPRECATED services::Status setupCompute() DAAL_C11_OVERRIDE;
96 DAAL_DEPRECATED_VIRTUAL
virtual services::Status allocateInput() DAAL_C11_OVERRIDE
98 Input *input =
static_cast<Input *
>(_in);
99 return input->allocate<algorithmFPType>(_par, (int) method);
120 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
121 class Batch :
public layers::forward::LayerIfaceImpl
124 typedef layers::forward::LayerIfaceImpl super;
126 typedef algorithms::neural_networks::layers::fullyconnected::forward::Input InputType;
127 typedef algorithms::neural_networks::layers::fullyconnected::Parameter ParameterType;
128 typedef algorithms::neural_networks::layers::fullyconnected::forward::Result ResultType;
130 ParameterType ¶meter;
138 DAAL_DEPRECATED Batch(
const size_t nOutputs) : _defaultParameter(nOutputs), parameter(_defaultParameter)
149 Batch(ParameterType& parameter) : parameter(parameter), _defaultParameter(parameter)
160 Batch(
const Batch<algorithmFPType, method> &other) : super(other),
161 _defaultParameter(other.parameter), parameter(_defaultParameter), input(other.input)
171 DAAL_DEPRECATED_VIRTUAL
virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
178 DAAL_DEPRECATED_VIRTUAL
virtual InputType *getLayerInput() DAAL_C11_OVERRIDE {
return &input; }
185 DAAL_DEPRECATED_VIRTUAL
virtual ParameterType *getLayerParameter() DAAL_C11_OVERRIDE {
return ¶meter; };
192 DAAL_DEPRECATED layers::forward::ResultPtr getLayerResult() DAAL_C11_OVERRIDE
202 ResultPtr getResult()
214 DAAL_DEPRECATED services::Status setResult(
const ResultPtr& result)
216 DAAL_CHECK(result, services::ErrorNullResult)
218 _res = _result.get();
219 return services::Status();
228 DAAL_DEPRECATED services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
230 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
239 DAAL_DEPRECATED_VIRTUAL
virtual services::Status allocateResult() DAAL_C11_OVERRIDE
241 services::Status s = this->_result->template allocate<algorithmFPType>(&(this->input), ¶meter, (
int) method);
242 this->_res = this->_result.get();
250 DAAL_DEPRECATED_VIRTUAL
virtual Batch<algorithmFPType, method> *cloneImpl() const DAAL_C11_OVERRIDE
252 return new Batch<algorithmFPType, method>(*this);
260 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_LAYER_CONTAINER(BatchContainer, algorithmFPType, method)(&_env);
263 _result.reset(
new ResultType());
268 ParameterType _defaultParameter;
272 using interface1::BatchContainer;
273 using interface1::Batch;
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Input::allocate
DAAL_EXPORT services::Status allocate(const daal::algorithms::Parameter *parameter, const int method)
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::setResult
DAAL_DEPRECATED services::Status setResult(const ResultPtr &result)
Definition: fullyconnected_layer_forward.h:214
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::clone
DAAL_DEPRECATED services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: fullyconnected_layer_forward.h:228
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::getMethod
virtual DAAL_DEPRECATED_VIRTUAL int getMethod() const DAAL_C11_OVERRIDE
Definition: fullyconnected_layer_forward.h:171
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::BatchContainer
Provides methods to run implementations of the forward fully-connected layer. This class is associate...
Definition: fullyconnected_layer_forward.h:67
daal::services::ErrorNullResult
Definition: error_indexes.h:98
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch
Provides methods for forward fully-connected layer computations in the batch processing mode ...
Definition: fullyconnected_layer_forward.h:121
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::allocateResult
virtual DAAL_DEPRECATED_VIRTUAL services::Status allocateResult() DAAL_C11_OVERRIDE
Definition: fullyconnected_layer_forward.h:239
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::parameter
ParameterType & parameter
Definition: fullyconnected_layer_forward.h:130
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::getLayerResult
DAAL_DEPRECATED layers::forward::ResultPtr getLayerResult() DAAL_C11_OVERRIDE
Definition: fullyconnected_layer_forward.h:192
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::getResult
ResultPtr getResult()
Definition: fullyconnected_layer_forward.h:202
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: fullyconnected_layer_forward.h:160
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Input
Input objects for the forward fully-connected layer
Definition: fullyconnected_layer_forward_types.h:66
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::BatchContainer::~BatchContainer
DAAL_DEPRECATED ~BatchContainer()
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::BatchContainer::BatchContainer
DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::Batch
DAAL_DEPRECATED Batch(const size_t nOutputs)
Definition: fullyconnected_layer_forward.h:138
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::BatchContainer::compute
DAAL_DEPRECATED services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::getLayerInput
virtual DAAL_DEPRECATED_VIRTUAL InputType * getLayerInput() DAAL_C11_OVERRIDE
Definition: fullyconnected_layer_forward.h:178
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::fullyconnected::forward::interface1::Batch::getLayerParameter
virtual DAAL_DEPRECATED_VIRTUAL ParameterType * getLayerParameter() DAAL_C11_OVERRIDE
Definition: fullyconnected_layer_forward.h:185
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::Batch
Batch(ParameterType ¶meter)
Definition: fullyconnected_layer_forward.h:149
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::input
InputType input
Definition: fullyconnected_layer_forward.h:131