22 #ifndef __LAYERS_TYPES_H__
23 #define __LAYERS_TYPES_H__
25 #include "algorithms/algorithm.h"
26 #include "data_management/data/tensor.h"
27 #include "services/daal_defines.h"
28 #include "services/collection.h"
29 #include "data_management/data/data_collection.h"
30 #include "algorithms/neural_networks/initializers/initializer.h"
31 #include "algorithms/neural_networks/initializers/uniform/uniform_initializer.h"
40 namespace neural_networks
61 lastLayerInputLayout = collectionInput
68 enum LayerResultLayout
72 lastLayerResultLayout = collectionResult
84 class DAAL_EXPORT Parameter:
public daal::algorithms::Parameter
91 initializers::InitializerIfacePtr weightsInitializer;
93 initializers::InitializerIfacePtr biasesInitializer;
97 bool propagateGradient;
99 bool weightsAndBiasesInitialized;
101 bool allowInplaceComputation;
107 typedef data_management::KeyValueDataCollection LayerData;
108 typedef services::SharedPtr<LayerData> LayerDataPtr;
120 NextLayers() : _indices(0)
128 NextLayers(
const NextLayers &other) : _indices(other._indices)
135 NextLayers(
const size_t index1) : _indices()
137 _indices.push_back(index1);
145 NextLayers(
const size_t index1,
const size_t index2) : _indices()
147 _indices.push_back(index1);
148 _indices.push_back(index2);
157 NextLayers(
const size_t index1,
const size_t index2,
const size_t index3) : _indices()
159 _indices.push_back(index1);
160 _indices.push_back(index2);
161 _indices.push_back(index3);
171 NextLayers(
const size_t index1,
const size_t index2,
const size_t index3,
const size_t index4) : _indices()
173 _indices.push_back(index1);
174 _indices.push_back(index2);
175 _indices.push_back(index3);
176 _indices.push_back(index4);
187 NextLayers(
const size_t index1,
const size_t index2,
const size_t index3,
const size_t index4,
188 const size_t index5) : _indices()
190 _indices.push_back(index1);
191 _indices.push_back(index2);
192 _indices.push_back(index3);
193 _indices.push_back(index4);
194 _indices.push_back(index5);
206 NextLayers(
const size_t index1,
const size_t index2,
const size_t index3,
const size_t index4,
const size_t index5,
207 const size_t index6) : _indices()
209 _indices.push_back(index1);
210 _indices.push_back(index2);
211 _indices.push_back(index3);
212 _indices.push_back(index4);
213 _indices.push_back(index5);
214 _indices.push_back(index6);
217 virtual ~NextLayers()
224 size_t size()
const {
return _indices.size(); }
231 size_t & operator [] (
size_t index)
233 return _indices[index];
241 const size_t & operator [] (
size_t index)
const
243 return _indices[index];
250 void push_back(
size_t index) { _indices.push_back(index); }
256 void add(
size_t index) { _indices.push_back(index); }
259 services::Collection<size_t> _indices;
263 using interface1::LayerData;
264 using interface1::LayerDataPtr;
265 using interface1::NextLayers;
266 using interface1::Parameter;
daal
Definition: algorithm_base_common.h:31
daal::algorithms::neural_networks::layers::interface1::Parameter::weightsAndBiasesInitialized
bool weightsAndBiasesInitialized
Definition: layer_types.h:99
daal::algorithms::neural_networks::layers::interface1::NextLayers::size
size_t size() const
Definition: layer_types.h:224
daal::algorithms::neural_networks::layers::interface1::Parameter
Definition: layer_types.h:84
daal::algorithms::neural_networks::layers::interface1::NextLayers
Contains list of layer indices of layers following the current layer.
Definition: layer_types.h:114
daal::algorithms::neural_networks::layers::interface1::NextLayers::NextLayers
NextLayers(const NextLayers &other)
Constructs the list of layer indices by copying the indices from another list of layer indices...
Definition: layer_types.h:128
daal::algorithms::neural_networks::layers::interface1::NextLayers::NextLayers
NextLayers(const size_t index1, const size_t index2)
Constructs the list of layer indices from two indices of the next layers.
Definition: layer_types.h:145
daal::algorithms::interface1::Parameter
Base class to represent computation parameters. Algorithm-specific parameters are represented as deri...
Definition: algorithm_types.h:60
daal::algorithms::neural_networks::layers::interface1::NextLayers::NextLayers
NextLayers(const size_t index1, const size_t index2, const size_t index3)
Constructs the list of layer indices from three indices of the next layers.
Definition: layer_types.h:157
daal::algorithms::neural_networks::layers::interface1::NextLayers::NextLayers
NextLayers(const size_t index1, const size_t index2, const size_t index3, const size_t index4, const size_t index5, const size_t index6)
Constructs the list of layer indices from six indices of the next layers.
Definition: layer_types.h:206
daal::algorithms::neural_networks::layers::interface1::Parameter::weightsInitializer
initializers::InitializerIfacePtr weightsInitializer
Definition: layer_types.h:91
daal::algorithms::neural_networks::layers::LayerInputLayout
LayerInputLayout
Definition: layer_types.h:57
daal::algorithms::neural_networks::layers::interface1::NextLayers::NextLayers
NextLayers(const size_t index1, const size_t index2, const size_t index3, const size_t index4, const size_t index5)
Constructs the list of layer indices from five indices of the next layers.
Definition: layer_types.h:187
daal::algorithms::neural_networks::layers::interface1::NextLayers::push_back
void push_back(size_t index)
Definition: layer_types.h:250
daal::algorithms::neural_networks::layers::interface1::NextLayers::NextLayers
NextLayers()
Constructs empty list of layer indices of layers following the current layer.
Definition: layer_types.h:120
daal::algorithms::neural_networks::layers::interface1::LayerData
data_management::KeyValueDataCollection LayerData
Contains extra input and output object of neural network layer.
Definition: layer_types.h:107
daal::algorithms::neural_networks::layers::LayerResultLayout
LayerResultLayout
Definition: layer_types.h:68
daal::algorithms::neural_networks::layers::interface1::Parameter::predictionStage
bool predictionStage
Definition: layer_types.h:95
daal::algorithms::neural_networks::layers::interface1::Parameter::biasesInitializer
initializers::InitializerIfacePtr biasesInitializer
Definition: layer_types.h:93
daal::algorithms::neural_networks::layers::interface1::Parameter::allowInplaceComputation
bool allowInplaceComputation
Definition: layer_types.h:101
daal::algorithms::neural_networks::layers::interface1::Parameter::propagateGradient
bool propagateGradient
Definition: layer_types.h:97
daal::algorithms::neural_networks::layers::interface1::NextLayers::add
void add(size_t index)
Definition: layer_types.h:256
daal::algorithms::neural_networks::layers::interface1::NextLayers::NextLayers
NextLayers(const size_t index1, const size_t index2, const size_t index3, const size_t index4)
Constructs the list of layer indices from four indices of the next layers.
Definition: layer_types.h:171
daal::algorithms::neural_networks::layers::interface1::NextLayers::NextLayers
NextLayers(const size_t index1)
Constructs the list of layer indices from one index of the next layer.
Definition: layer_types.h:135
daal::algorithms::neural_networks::layers::interface1::NextLayers::operator[]
size_t & operator[](size_t index)
Definition: layer_types.h:231