NOTE: It is a preview version of the Inference Engine Neural Network Builder API for evaluation purpose only. Module structure and API itself may be changed in future releases.
This API extends the Inference Engine functionality that allows to create and modify topologies in the source code.
InferenceEngine::Builder::Network
allows to create and modify graphs. This class does not modify the original graph if it is used for graph modification. Instead, it creates a copy of the original graph and works with a copied object. Also the use of this class allows to avoid invalid graphs because it checks:
If a graph contains custom layers and shape inference is required, you should add Functions for shape inference to the Network builder from custom Context.
Network builder contains the following methods for graph modification:
addLayer(...)
allows to add new layer builders to the network builder. This method creates a copy of the original layer builder, puts the copy to the network builder, and returns the ID of the layer builder which was added to the network builder.removeLayer(...)
allows to remove layer builder from the network builder by ID.connect(...)
allows to connect two layer builders using layer builder IDs and port indexes.disconnect(...)
allows to remove connection from the network builder.getLayer(...)
allows to get the layer builder from the network builder by ID.getLayerConnections(...)
allows to get all connections for a layer builder by ID.getLayers()
allows to get all layer builders.build()
allows to generate Inference Engine Network. This method validates each layer builder and graph structure and creates INetwork.The function convertToICNNNetwork(...)
converts INetwork to CNNNetwork.
InferenceEngine::Builder::Layer
class creates and modifies layers. This class allows you to modify all layer parameters, add new constant data, change type and name of the layer, and create a valid layer object.
Each default Inference Engine layer has a special builder added in order to simplify the process of layer creation. These builders hide all unnecessary methods for the specific layer and add new methods.
Below you can see the list of builders for default layers:
InferenceEngine::Builder::ArgMax
InferenceEngine::Builder::BatchNormalization
InferenceEngine::Builder::Clamp
InferenceEngine::Builder::Concat
InferenceEngine::Builder::Const
InferenceEngine::Builder::Convolution
InferenceEngine::Builder::Crop
InferenceEngine::Builder::CTCGreedyDecoder
InferenceEngine::Builder::Deconvolution
InferenceEngine::Builder::DetectionOutput
InferenceEngine::Builder::Eltwise
InferenceEngine::Builder::ELU
InferenceEngine::Builder::FullyConnected
InferenceEngine::Builder::GRN
InferenceEngine::Builder::GRNSequence
InferenceEngine::Builder::Input
InferenceEngine::Builder::LRN
InferenceEngine::Builder::LSTMSequence
InferenceEngine::Builder::Memory
InferenceEngine::Builder::MVN
InferenceEngine::Builder::Norm
InferenceEngine::Builder::Normalize
InferenceEngine::Builder::Output
InferenceEngine::Builder::Permute
InferenceEngine::Builder::Pooling
InferenceEngine::Builder::Power
InferenceEngine::Builder::PReLU
InferenceEngine::Builder::PriorBoxClustered
InferenceEngine::Builder::PriorBox
InferenceEngine::Builder::Proposal
InferenceEngine::Builder::PSROIPooling
InferenceEngine::Builder::RegionYolo
InferenceEngine::Builder::ReLU6
InferenceEngine::Builder::ReLU
InferenceEngine::Builder::ReorgYolo
InferenceEngine::Builder::Resample
InferenceEngine::Builder::Reshape
InferenceEngine::Builder::RNNSequence
InferenceEngine::Builder::ROIPooling
InferenceEngine::Builder::ScaleShift
InferenceEngine::Builder::Sigmoid
InferenceEngine::Builder::SimplerNMS
InferenceEngine::Builder::SoftMax
InferenceEngine::Builder::Split
InferenceEngine::Builder::TanH
InferenceEngine::Builder::Tile
The Inference Engine Neural Network Builder API does not support the TensorIterator layer.
To use the NN Builder API, include ie_builders.hpp
header which includes all Inference Engine builders.
After that, all builders will be available to use.
The NN Builder can be created in different ways:
You can modify a graph with the NN Builder: