48 #ifndef __LAYERS_TYPES_H__
49 #define __LAYERS_TYPES_H__
51 #include "algorithms/algorithm.h"
52 #include "data_management/data/tensor.h"
53 #include "services/daal_defines.h"
54 #include "services/collection.h"
55 #include "data_management/data/data_collection.h"
56 #include "algorithms/neural_networks/initializers/initializer.h"
57 #include "algorithms/neural_networks/initializers/uniform/uniform_initializer.h"
66 namespace neural_networks
87 lastLayerInputLayout = collectionInput
94 enum LayerResultLayout
98 lastLayerResultLayout = collectionResult
110 class DAAL_EXPORT Parameter:
public daal::algorithms::Parameter
117 initializers::InitializerIfacePtr weightsInitializer;
119 initializers::InitializerIfacePtr biasesInitializer;
121 bool predictionStage;
123 bool propagateGradient;
125 bool weightsAndBiasesInitialized;
127 bool allowInplaceComputation;
133 typedef data_management::KeyValueDataCollection LayerData;
134 typedef services::SharedPtr<LayerData> LayerDataPtr;
146 NextLayers() : _indices(0)
154 NextLayers(
const NextLayers &other) : _indices(other._indices)
161 NextLayers(
const size_t index1) : _indices()
163 _indices.push_back(index1);
171 NextLayers(
const size_t index1,
const size_t index2) : _indices()
173 _indices.push_back(index1);
174 _indices.push_back(index2);
183 NextLayers(
const size_t index1,
const size_t index2,
const size_t index3) : _indices()
185 _indices.push_back(index1);
186 _indices.push_back(index2);
187 _indices.push_back(index3);
197 NextLayers(
const size_t index1,
const size_t index2,
const size_t index3,
const size_t index4) : _indices()
199 _indices.push_back(index1);
200 _indices.push_back(index2);
201 _indices.push_back(index3);
202 _indices.push_back(index4);
213 NextLayers(
const size_t index1,
const size_t index2,
const size_t index3,
const size_t index4,
214 const size_t index5) : _indices()
216 _indices.push_back(index1);
217 _indices.push_back(index2);
218 _indices.push_back(index3);
219 _indices.push_back(index4);
220 _indices.push_back(index5);
232 NextLayers(
const size_t index1,
const size_t index2,
const size_t index3,
const size_t index4,
const size_t index5,
233 const size_t index6) : _indices()
235 _indices.push_back(index1);
236 _indices.push_back(index2);
237 _indices.push_back(index3);
238 _indices.push_back(index4);
239 _indices.push_back(index5);
240 _indices.push_back(index6);
243 virtual ~NextLayers()
250 size_t size()
const {
return _indices.size(); }
257 size_t & operator [] (
size_t index)
259 return _indices[index];
267 const size_t & operator [] (
size_t index)
const
269 return _indices[index];
276 void push_back(
size_t index) { _indices.push_back(index); }
282 void add(
size_t index) { _indices.push_back(index); }
285 services::Collection<size_t> _indices;
289 using interface1::LayerData;
290 using interface1::LayerDataPtr;
291 using interface1::NextLayers;
292 using interface1::Parameter;
daal
Definition: algorithm_base_common.h:57
daal::algorithms::neural_networks::layers::interface1::Parameter::weightsAndBiasesInitialized
bool weightsAndBiasesInitialized
Definition: layer_types.h:125
daal::algorithms::neural_networks::layers::interface1::NextLayers::size
size_t size() const
Definition: layer_types.h:250
daal::algorithms::neural_networks::layers::interface1::Parameter
Definition: layer_types.h:110
daal::algorithms::neural_networks::layers::interface1::NextLayers
Contains list of layer indices of layers following the current layer.
Definition: layer_types.h:140
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:154
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:171
daal::algorithms::interface1::Parameter
Base class to represent computation parameters. Algorithm-specific parameters are represented as deri...
Definition: algorithm_types.h:86
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:183
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:232
daal::algorithms::neural_networks::layers::interface1::Parameter::weightsInitializer
initializers::InitializerIfacePtr weightsInitializer
Definition: layer_types.h:117
daal::algorithms::neural_networks::layers::LayerInputLayout
LayerInputLayout
Definition: layer_types.h:83
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:213
daal::algorithms::neural_networks::layers::interface1::NextLayers::push_back
void push_back(size_t index)
Definition: layer_types.h:276
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:146
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:133
daal::algorithms::neural_networks::layers::LayerResultLayout
LayerResultLayout
Definition: layer_types.h:94
daal::algorithms::neural_networks::layers::interface1::Parameter::predictionStage
bool predictionStage
Definition: layer_types.h:121
daal::algorithms::neural_networks::layers::interface1::Parameter::biasesInitializer
initializers::InitializerIfacePtr biasesInitializer
Definition: layer_types.h:119
daal::algorithms::neural_networks::layers::interface1::Parameter::allowInplaceComputation
bool allowInplaceComputation
Definition: layer_types.h:127
daal::algorithms::neural_networks::layers::interface1::Parameter::propagateGradient
bool propagateGradient
Definition: layer_types.h:123
daal::algorithms::neural_networks::layers::interface1::NextLayers::add
void add(size_t index)
Definition: layer_types.h:282
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:197
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:161
daal::algorithms::neural_networks::layers::interface1::NextLayers::operator[]
size_t & operator[](size_t index)
Definition: layer_types.h:257