49 #ifndef __FULLYCONNECTED_LAYER_FORWARD_H__
50 #define __FULLYCONNECTED_LAYER_FORWARD_H__
52 #include "algorithms/algorithm.h"
53 #include "data_management/data/tensor.h"
54 #include "services/daal_defines.h"
55 #include "algorithms/neural_networks/layers/layer.h"
56 #include "algorithms/neural_networks/layers/fullyconnected/fullyconnected_layer_types.h"
57 #include "algorithms/neural_networks/layers/fullyconnected/fullyconnected_layer_forward_types.h"
63 namespace neural_networks
67 namespace fullyconnected
88 template<
typename algorithmFPType, Method method, CpuType cpu>
89 class DAAL_EXPORT BatchContainer :
public layers::forward::LayerContainerIfaceImpl
97 BatchContainer(daal::services::Environment::env *daalEnv);
105 services::Status compute() DAAL_C11_OVERRIDE;
106 services::Status setupCompute() DAAL_C11_OVERRIDE;
107 virtual services::Status allocateInput() DAAL_C11_OVERRIDE
109 Input *input =
static_cast<Input *
>(_in);
110 return input->allocate<algorithmFPType>(_par, (int) method);
129 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
130 class Batch :
public layers::forward::LayerIfaceImpl
133 typedef layers::forward::LayerIfaceImpl super;
134 Parameter ¶meter;
141 Batch(
const size_t nOutputs) : _defaultParameter(nOutputs), parameter(_defaultParameter)
151 Batch(Parameter& parameter) : parameter(parameter), _defaultParameter(parameter)
161 Batch(
const Batch<algorithmFPType, method> &other) : super(other),
162 _defaultParameter(other.parameter), parameter(_defaultParameter), input(other.input)
171 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
177 virtual Input *getLayerInput() DAAL_C11_OVERRIDE {
return &input; }
183 virtual Parameter *getLayerParameter() DAAL_C11_OVERRIDE {
return ¶meter; };
189 layers::forward::ResultPtr getLayerResult() DAAL_C11_OVERRIDE
198 ResultPtr getResult()
209 services::Status setResult(
const ResultPtr& result)
211 DAAL_CHECK(result, services::ErrorNullResult)
213 _res = _result.get();
214 return services::Status();
222 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
224 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
232 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
234 services::Status s = this->_result->template allocate<algorithmFPType>(&(this->input), ¶meter, (
int) method);
235 this->_res = this->_result.get();
240 virtual Batch<algorithmFPType, method> *cloneImpl() const DAAL_C11_OVERRIDE
242 return new Batch<algorithmFPType, method>(*this);
247 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_LAYER_CONTAINER(BatchContainer, algorithmFPType, method)(&_env);
250 _result.reset(
new Result());
255 Parameter _defaultParameter;
259 using interface1::BatchContainer;
260 using interface1::Batch;
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::parameter
Parameter & parameter
Definition: fullyconnected_layer_forward.h:134
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::getLayerParameter
virtual Parameter * getLayerParameter() DAAL_C11_OVERRIDE
Definition: fullyconnected_layer_forward.h:183
daal
Definition: algorithm_base_common.h:57
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::allocateResult
virtual services::Status allocateResult() DAAL_C11_OVERRIDE
Definition: fullyconnected_layer_forward.h:232
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: fullyconnected_layer_forward.h:222
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: fullyconnected_layer_forward.h:161
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: fullyconnected_layer_forward.h:171
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::getLayerInput
virtual Input * getLayerInput() DAAL_C11_OVERRIDE
Definition: fullyconnected_layer_forward.h:177
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:130
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::getLayerResult
layers::forward::ResultPtr getLayerResult() DAAL_C11_OVERRIDE
Definition: fullyconnected_layer_forward.h:189
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: fullyconnected_layer_forward.h:209
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::Batch
Batch(const size_t nOutputs)
Definition: fullyconnected_layer_forward.h:141
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:89
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::input
Input input
Definition: fullyconnected_layer_forward.h:135
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::getResult
ResultPtr getResult()
Definition: fullyconnected_layer_forward.h:198
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:94
daal::algorithms::neural_networks::layers::fullyconnected::forward::interface1::Batch::Batch
Batch(Parameter ¶meter)
Definition: fullyconnected_layer_forward.h:151
daal::services::ErrorNullResult
Definition: error_indexes.h:122