42 #ifndef __NEURAL_NETWORKS_TRAINING_TOPOLOGY_H__ 43 #define __NEURAL_NETWORKS_TRAINING_TOPOLOGY_H__ 45 #include "algorithms/neural_networks/layers/layer_descriptor.h" 51 namespace neural_networks
66 class Topology:
public Base
76 Topology(
const Topology &t) : _config(t.size())
78 for(
size_t i = 0; i < t.size(); i++)
80 _config[i] = layers::LayerDescriptor(i, t[i].layer(), t[i].nextLayers());
88 size_t size()
const {
return _config.size(); }
95 size_t push_back(
const layers::LayerIfacePtr &layer)
97 size_t id = _config.size();
98 _config.push_back(layers::LayerDescriptor(
id, layer));
107 size_t add(
const layers::LayerIfacePtr &layer)
109 return push_back(layer);
118 size_t add(
const Topology &topologyBlock,
size_t &startIndex)
120 size_t size = _config.size();
124 for(
size_t i = 0; i < topologyBlock.size(); i++)
126 id = push_back(topologyBlock[i].layer());
128 const layers::NextLayers& nextLayers = topologyBlock[i].nextLayers();
129 for(
size_t j = 0; j < nextLayers.size(); j++)
131 get(i + size).addNext(nextLayers[j] + size);
142 services::Status clear()
145 return services::Status();
153 layers::LayerDescriptor& operator [] (
size_t index) {
return _config[index]; }
160 const layers::LayerDescriptor& operator [] (
size_t index)
const {
return _config[index]; }
167 layers::LayerDescriptor&
get(
size_t index) {
return _config[index]; }
174 const layers::LayerDescriptor&
get(
size_t index)
const {
return _config[index]; }
184 DAAL_DEPRECATED services::Status addNext(
size_t index,
size_t next)
186 _config[index].addNext(next);
187 return services::Status();
191 services::Collection<layers::LayerDescriptor> _config;
194 typedef services::SharedPtr<Topology> TopologyPtr;
197 using interface1::Topology;
198 using interface1::TopologyPtr;
daal::algorithms::neural_networks::layers::interface1::LayerDescriptor
Class defining descriptor for layer on both forward and backward stages and its parameters.
Definition: layer_descriptor.h:71
daal::algorithms::neural_networks::training::interface1::Topology
Class defining a neural network topology - a set of layers and connection between them - on the train...
Definition: neural_networks_training_topology.h:66
daal::algorithms::neural_networks::training::interface1::Topology::push_back
size_t push_back(const layers::LayerIfacePtr &layer)
Definition: neural_networks_training_topology.h:95
daal::services::interface1::Status
Class that holds the results of API calls. In case of API routine failure it contains the list of err...
Definition: error_handling.h:491
daal
Definition: algorithm_base_common.h:57
daal::algorithms::neural_networks::training::interface1::Topology::add
size_t add(const Topology &topologyBlock, size_t &startIndex)
Definition: neural_networks_training_topology.h:118
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::training::interface1::Topology::Topology
Topology()
Definition: neural_networks_training_topology.h:70
daal::algorithms::neural_networks::training::interface1::Topology::size
size_t size() const
Definition: neural_networks_training_topology.h:88
daal::algorithms::neural_networks::training::interface1::Topology::clear
services::Status clear()
Definition: neural_networks_training_topology.h:142
daal::services::interface1::SharedPtr
Shared pointer that retains shared ownership of an object through a pointer. Several SharedPtr object...
Definition: daal_shared_ptr.h:187
daal::algorithms::neural_networks::training::interface1::Topology::Topology
Topology(const Topology &t)
Definition: neural_networks_training_topology.h:76
daal::algorithms::neural_networks::training::interface1::Topology::operator[]
layers::LayerDescriptor & operator[](size_t index)
Definition: neural_networks_training_topology.h:153
daal::Base
Base class for Intel(R) Data Analytics Acceleration Library objects
Definition: base.h:65
daal::algorithms::neural_networks::layers::interface1::NextLayers::size
size_t size() const
Definition: layer_types.h:250
daal::algorithms::neural_networks::training::interface1::Topology::add
size_t add(const layers::LayerIfacePtr &layer)
Definition: neural_networks_training_topology.h:107
daal::algorithms::neural_networks::training::interface1::Topology::addNext
DAAL_DEPRECATED services::Status addNext(size_t index, size_t next)
Definition: neural_networks_training_topology.h:184
daal::services::interface1::Collection
Class that implements functionality of the Collection container.
Definition: collection.h:69