Skip to content

morapi_DnnNet Struct Reference

dnn

Dnn net.
More...

#include <morapi_softneuro.h>

Public Member Functions


Layers

morapi_DnnLayer morapi_DnnNet_addLayer (morapi_DnnNet *self, const morapi_Char *i_name, const morapi_Char *i_type)
morapi_Result  morapi_DnnNet_removeLayer (morapi_DnnNet *self, morapi_DnnLayer *io_layer)
morapi_Int32  morapi_DnnNet_getLayerNum (const morapi_DnnNet *self)
morapi_DnnLayer morapi_DnnNet_getLayer (const morapi_DnnNet *self, morapi_Int32 i_index)
morapi_DnnLayer morapi_DnnNet_findLayer (const morapi_DnnNet *self, const morapi_Char *i_name)

I/O

morapi_Int32  morapi_DnnNet_getInputNum (const morapi_DnnNet *self)
morapi_Tensor morapi_DnnNet_getInput (const morapi_DnnNet *self, morapi_Int32 i_input_index)
morapi_Int32  morapi_DnnNet_getOutputNum (const morapi_DnnNet *self)
morapi_Tensor morapi_DnnNet_getOutput (const morapi_DnnNet *self, morapi_Int32 i_output_index)

Net

morapi_Dnn morapi_DnnNet_getOwner (const morapi_DnnNet *self)
const morapi_Char morapi_DnnNet_getName (const morapi_DnnNet *self)
morapi_Result  morapi_DnnNet_clear (morapi_DnnNet *self)
morapi_Result  morapi_DnnNet_pipe (morapi_DnnNet *self, morapi_Int32 i_output_index, morapi_DnnNet *i_piped_net, morapi_Int32 i_input_index)
morapi_Result  morapi_DnnNet_unpipe (morapi_DnnNet *self, morapi_Int32 i_output_index, morapi_DnnNet *i_piped_net, morapi_Int32 i_input_index)
morapi_DnnNet morapi_DnnNet_getPrevNet (const morapi_DnnNet *net, morapi_Int32 i_input_index)
morapi_Int32  morapi_DnnNet_getPrevNetOutputIndex (const morapi_DnnNet *net, morapi_Int32 i_input_index)
morapi_Int32  morapi_DnnNet_getNextNetNumAt (const morapi_DnnNet *net, morapi_Int32 i_output_index)
morapi_DnnNet morapi_DnnNet_getNextNet (const morapi_DnnNet *net, morapi_Int32 i_output_index, morapi_Int32 i_next_index)
morapi_Int32  morapi_DnnNet_getNextNetInputIndex (const morapi_DnnNet *net, morapi_Int32 i_output_index, morapi_Int32 i_next_index)


Detailed Description

Dnn net.


test_decompose_api.c, and test_dnn_api.c.


Member Function Documentation


morapi_DnnNet_addLayer()

morapi_DnnLayer * morapi_DnnNet_addLayer (morapi_DnnNet * self,
                                          const morapi_Char * i_name,
                                          const morapi_Char * i_type)

Adds a layer.

The state is changed to MORAPI_DNN_NET_STATE_INITIALIZED.

Parameters

  • self : net object
  • i_name : layer name
  • i_type : layer type


morapi_DnnNet_removeLayer()

morapi_Result morapi_DnnNet_removeLayer (morapi_DnnNet * self,
                                         morapi_DnnLayer * io_layer)

Removes a layer.

The state is changed to MORAPI_DNN_NET_STATE_INITIALIZED.

Parameters

  • self : net object
  • io_layer : layer to be removed


morapi_DnnNet_getLayerNum()

morapi_Int32 morapi_DnnNet_getLayerNum (const morapi_DnnNet * self)

Gets the number of layers in the DnnNet subnetwork.

Parameters

  • self : net object

test_dnn_api.c.


morapi_DnnNet_getLayer()

morapi_DnnLayer * morapi_DnnNet_getLayer (const morapi_DnnNet * self,
                                          morapi_Int32 i_index)

Gets the i_index-th layer in the DnnNet subnetwork.

Parameters

  • self : net object
  • i_index : layer index

test_dnn_api.c.


morapi_DnnNet_findLayer()

morapi_DnnLayer * morapi_DnnNet_findLayer (const morapi_DnnNet * self,
                                           const morapi_Char * i_name)

Gets the layer named i_name in the DnnNet subnetwork.

Parameters

  • self : net object
  • i_name : layer name

test_decompose_api.c.


morapi_DnnNet_getInputNum()

morapi_Int32 morapi_DnnNet_getInputNum (const morapi_DnnNet * self)

Gets the number of inputs.

Parameters

  • self : net object


morapi_DnnNet_getInput()

morapi_Tensor * morapi_DnnNet_getInput (const morapi_DnnNet * self,
                                        morapi_Int32 i_input_index)

Gets the i_input_index-th input tensor.

Parameters

  • self : net object
  • i_input_index : input index


morapi_DnnNet_getOutputNum()

morapi_Int32 morapi_DnnNet_getOutputNum (const morapi_DnnNet * self)

Gets the number of outputs.

Parameters

  • self : net object


morapi_DnnNet_getOutput()

morapi_Tensor * morapi_DnnNet_getOutput (const morapi_DnnNet * self,
                                         morapi_Int32 i_output_index)

Gets the i_output_index-th output tensor.

Parameters

  • self : net object
  • i_output_index : output index


morapi_DnnNet_getOwner()

morapi_Dnn * morapi_DnnNet_getOwner (const morapi_DnnNet * self)

Gets the owner dnn.

Parameters

  • self : net object


morapi_DnnNet_getName()

const morapi_Char * morapi_DnnNet_getName (const morapi_DnnNet * self)

Gets the name.

Parameters

  • self : net object


morapi_DnnNet_clear()

morapi_Result morapi_DnnNet_clear (morapi_DnnNet * self)

Clears.

Removes all layers.

Parameters

  • self : net object


morapi_DnnNet_pipe()

morapi_Result morapi_DnnNet_pipe (morapi_DnnNet * self,
                                  morapi_Int32 i_output_index,
                                  morapi_DnnNet * i_piped_net,
                                  morapi_Int32 i_input_index)

Pipes the i_output_index-th output to the i_input_index-th input of i_next_net.

Parameters

  • self : net object
  • i_output_index : index of the ouput on a pipe end
  • i_piped_net : net to be piped to
  • i_input_index : index of the input on the other pipe end


morapi_DnnNet_unpipe()

morapi_Result morapi_DnnNet_unpipe (morapi_DnnNet * self,
                                    morapi_Int32 i_output_index,
                                    morapi_DnnNet * i_piped_net,
                                    morapi_Int32 i_input_index)

Unpipes the i_output_index-th output to the i_input_index-th input of i_next_layer.

Parameters

  • self : net object
  • i_output_index : index of the ouput on a pipe end
  • i_piped_net : net to be unpiped
  • i_input_index : index of the input on the other pipe end


morapi_DnnNet_getPrevNet()

morapi_DnnNet * morapi_DnnNet_getPrevNet (const morapi_DnnNet * net,
                                          morapi_Int32 i_input_index)

Gets a previous net connected to the i_input_index-th input.

Parameters

  • net : net object
  • i_input_index : input index


morapi_DnnNet_getPrevNetOutputIndex()

morapi_Int32 morapi_DnnNet_getPrevNetOutputIndex (const morapi_DnnNet * net,
                                                  morapi_Int32 i_input_index)

Gets an output index of previous net connected to the i_input_index-th input.

Parameters

  • net : net object
  • i_input_index : input index


morapi_DnnNet_getNextNetNumAt()

morapi_Int32 morapi_DnnNet_getNextNetNumAt (const morapi_DnnNet * net,
                                            morapi_Int32 i_output_index)

Gets the number of next nets connected from the i_output_index-th output.

Parameters

  • net : net object
  • i_output_index : output_index


morapi_DnnNet_getNextNet()

morapi_DnnNet * morapi_DnnNet_getNextNet (const morapi_DnnNet * net,
                                          morapi_Int32 i_output_index,
                                          morapi_Int32 i_next_index)

Gets the i_next_index-th next net connected from the i_output_index-th output.

Parameters

  • net : net object
  • i_output_index : output index
  • i_next_index : next net index


morapi_DnnNet_getNextNetInputIndex()

morapi_Int32 morapi_DnnNet_getNextNetInputIndex (const morapi_DnnNet * net,
                                                 morapi_Int32 i_output_index,
                                                 morapi_Int32 i_next_index)

Gets the input index of the i_next_index-th next net connected from the i_output_index-th output.

Parameters

  • net : net object
  • i_output_index : output index
  • i_next_index : next input index