pub trait NetTraitConst {
Show 30 methods fn as_raw_Net(&self) -> *const c_void; fn empty(&self) -> Result<bool> { ... } fn get_layer_id(&self, layer: &str) -> Result<i32> { ... } fn get_layer_names(&self) -> Result<Vector<String>> { ... } fn get_layer(&self, layer_id: i32) -> Result<Ptr<Layer>> { ... } fn get_layer_1(&self, layer_name: &str) -> Result<Ptr<Layer>> { ... } fn get_layer_2(&self, layer_id: &Net_LayerId) -> Result<Ptr<Layer>> { ... } fn get_layer_inputs(&self, layer_id: i32) -> Result<Vector<Ptr<Layer>>> { ... } fn get_input_details(
        &self,
        scales: &mut Vector<f32>,
        zeropoints: &mut Vector<i32>
    ) -> Result<()> { ... } fn get_output_details(
        &self,
        scales: &mut Vector<f32>,
        zeropoints: &mut Vector<i32>
    ) -> Result<()> { ... } fn get_param(&self, layer: i32, num_param: i32) -> Result<Mat> { ... } fn get_param_1(&self, layer_name: &str, num_param: i32) -> Result<Mat> { ... } fn get_unconnected_out_layers(&self) -> Result<Vector<i32>> { ... } fn get_unconnected_out_layers_names(&self) -> Result<Vector<String>> { ... } fn get_layers_shapes(
        &self,
        net_input_shapes: &Vector<MatShape>,
        layers_ids: &mut Vector<i32>,
        in_layers_shapes: &mut Vector<Vector<MatShape>>,
        out_layers_shapes: &mut Vector<Vector<MatShape>>
    ) -> Result<()> { ... } fn get_layers_shapes_1(
        &self,
        net_input_shape: &MatShape,
        layers_ids: &mut Vector<i32>,
        in_layers_shapes: &mut Vector<Vector<MatShape>>,
        out_layers_shapes: &mut Vector<Vector<MatShape>>
    ) -> Result<()> { ... } fn get_layer_shapes(
        &self,
        net_input_shape: &MatShape,
        layer_id: i32,
        in_layer_shapes: &mut Vector<MatShape>,
        out_layer_shapes: &mut Vector<MatShape>
    ) -> Result<()> { ... } fn get_layer_shapes_1(
        &self,
        net_input_shapes: &Vector<MatShape>,
        layer_id: i32,
        in_layer_shapes: &mut Vector<MatShape>,
        out_layer_shapes: &mut Vector<MatShape>
    ) -> Result<()> { ... } fn get_flops(&self, net_input_shapes: &Vector<MatShape>) -> Result<i64> { ... } fn get_flops_1(&self, net_input_shape: &MatShape) -> Result<i64> { ... } fn get_flops_2(
        &self,
        layer_id: i32,
        net_input_shapes: &Vector<MatShape>
    ) -> Result<i64> { ... } fn get_flops_3(
        &self,
        layer_id: i32,
        net_input_shape: &MatShape
    ) -> Result<i64> { ... } fn get_layer_types(&self, layers_types: &mut Vector<String>) -> Result<()> { ... } fn get_layers_count(&self, layer_type: &str) -> Result<i32> { ... } fn get_memory_consumption(
        &self,
        net_input_shapes: &Vector<MatShape>,
        weights: &mut size_t,
        blobs: &mut size_t
    ) -> Result<()> { ... } fn get_memory_consumption_1(
        &self,
        net_input_shape: &MatShape,
        weights: &mut size_t,
        blobs: &mut size_t
    ) -> Result<()> { ... } fn get_memory_consumption_for_layer(
        &self,
        layer_id: i32,
        net_input_shapes: &Vector<MatShape>,
        weights: &mut size_t,
        blobs: &mut size_t
    ) -> Result<()> { ... } fn get_memory_consumption_2(
        &self,
        layer_id: i32,
        net_input_shape: &MatShape,
        weights: &mut size_t,
        blobs: &mut size_t
    ) -> Result<()> { ... } fn get_memory_consumption_for_layers(
        &self,
        net_input_shapes: &Vector<MatShape>,
        layer_ids: &mut Vector<i32>,
        weights: &mut Vector<size_t>,
        blobs: &mut Vector<size_t>
    ) -> Result<()> { ... } fn get_memory_consumption_3(
        &self,
        net_input_shape: &MatShape,
        layer_ids: &mut Vector<i32>,
        weights: &mut Vector<size_t>,
        blobs: &mut Vector<size_t>
    ) -> Result<()> { ... }
}
Expand description

This class allows to create and manipulate comprehensive artificial neural networks.

Neural network is presented as directed acyclic graph (DAG), where vertices are Layer instances, and edges specify relationships between layers inputs and outputs.

Each network layer has unique integer id and unique string name inside its network. LayerId can store either layer name or layer id.

This class supports reference counting of its instances, i. e. copies point to the same instance.

Required Methods

Provided Methods

Returns true if there are no layers in the network.

Converts string name of the layer to the integer identifier.

Returns

id of the layer, or -1 if the layer wasn’t found.

Returns pointer to layer with specified id or name which the network use.

👎Deprecated: Use int getLayerId(const String &layer)

Returns pointer to layer with specified id or name which the network use.

Overloaded parameters

Deprecated: Use int getLayerId(const String &layer)

👎Deprecated: to be removed

Returns pointer to layer with specified id or name which the network use.

Overloaded parameters

Deprecated: to be removed

Returns pointers to input layers of specific layer.

Returns input scale and zeropoint for a quantized Net.

Parameters
  • scales: output parameter for returning input scales.
  • zeropoints: output parameter for returning input zeropoints.

Returns output scale and zeropoint for a quantized Net.

Parameters
  • scales: output parameter for returning output scales.
  • zeropoints: output parameter for returning output zeropoints.

Returns parameter blob of the layer.

Parameters
  • layer: name or id of the layer.
  • numParam: index of the layer parameter in the Layer::blobs array.
See also

Layer::blobs

C++ default parameters
  • num_param: 0

Returns indexes of layers with unconnected outputs.

FIXIT: Rework API to registerOutput() approach, deprecate this call

Returns names of layers with unconnected outputs.

FIXIT: Rework API to registerOutput() approach, deprecate this call

Returns input and output shapes for all layers in loaded model; preliminary inferencing isn’t necessary.

Parameters
  • netInputShapes: shapes for all input blobs in net input layer.
  • layersIds: output parameter for layer IDs.
  • inLayersShapes: output parameter for input layers shapes; order is the same as in layersIds
  • outLayersShapes: output parameter for output layers shapes; order is the same as in layersIds

Returns input and output shapes for all layers in loaded model; preliminary inferencing isn’t necessary.

Parameters
  • netInputShapes: shapes for all input blobs in net input layer.
  • layersIds: output parameter for layer IDs.
  • inLayersShapes: output parameter for input layers shapes; order is the same as in layersIds
  • outLayersShapes: output parameter for output layers shapes; order is the same as in layersIds
Overloaded parameters

Returns input and output shapes for layer with specified id in loaded model; preliminary inferencing isn’t necessary.

Parameters
  • netInputShape: shape input blob in net input layer.
  • layerId: id for layer.
  • inLayerShapes: output parameter for input layers shapes; order is the same as in layersIds
  • outLayerShapes: output parameter for output layers shapes; order is the same as in layersIds

Returns input and output shapes for layer with specified id in loaded model; preliminary inferencing isn’t necessary.

Parameters
  • netInputShape: shape input blob in net input layer.
  • layerId: id for layer.
  • inLayerShapes: output parameter for input layers shapes; order is the same as in layersIds
  • outLayerShapes: output parameter for output layers shapes; order is the same as in layersIds
Overloaded parameters

Computes FLOP for whole loaded model with specified input shapes.

Parameters
  • netInputShapes: vector of shapes for all net inputs.
Returns

computed FLOP.

Computes FLOP for whole loaded model with specified input shapes.

Parameters
  • netInputShapes: vector of shapes for all net inputs.
Returns

computed FLOP.

Overloaded parameters

Computes FLOP for whole loaded model with specified input shapes.

Parameters
  • netInputShapes: vector of shapes for all net inputs.
Returns

computed FLOP.

Overloaded parameters

Computes FLOP for whole loaded model with specified input shapes.

Parameters
  • netInputShapes: vector of shapes for all net inputs.
Returns

computed FLOP.

Overloaded parameters

Returns list of types for layer used in model.

Parameters
  • layersTypes: output parameter for returning types.

Returns count of layers of specified type.

Parameters
  • layerType: type.
Returns

count of layers

Computes bytes number which are required to store all weights and intermediate blobs for model.

Parameters
  • netInputShapes: vector of shapes for all net inputs.
  • weights: output parameter to store resulting bytes for weights.
  • blobs: output parameter to store resulting bytes for intermediate blobs.

Computes bytes number which are required to store all weights and intermediate blobs for model.

Parameters
  • netInputShapes: vector of shapes for all net inputs.
  • weights: output parameter to store resulting bytes for weights.
  • blobs: output parameter to store resulting bytes for intermediate blobs.
Overloaded parameters

Computes bytes number which are required to store all weights and intermediate blobs for model.

Parameters
  • netInputShapes: vector of shapes for all net inputs.
  • weights: output parameter to store resulting bytes for weights.
  • blobs: output parameter to store resulting bytes for intermediate blobs.
Overloaded parameters

Computes bytes number which are required to store all weights and intermediate blobs for model.

Parameters
  • netInputShapes: vector of shapes for all net inputs.
  • weights: output parameter to store resulting bytes for weights.
  • blobs: output parameter to store resulting bytes for intermediate blobs.
Overloaded parameters

Computes bytes number which are required to store all weights and intermediate blobs for each layer.

Parameters
  • netInputShapes: vector of shapes for all net inputs.
  • layerIds: output vector to save layer IDs.
  • weights: output parameter to store resulting bytes for weights.
  • blobs: output parameter to store resulting bytes for intermediate blobs.

Computes bytes number which are required to store all weights and intermediate blobs for each layer.

Parameters
  • netInputShapes: vector of shapes for all net inputs.
  • layerIds: output vector to save layer IDs.
  • weights: output parameter to store resulting bytes for weights.
  • blobs: output parameter to store resulting bytes for intermediate blobs.
Overloaded parameters

Implementors