Class Layer


public class Layer extends Algorithm
This interface class allows to build new Layers - are building blocks of networks. Each class, derived from Layer, must implement forward() method to compute outputs. Also before using the new layer into networks you must register your layer by using one of REF: dnnLayerFactory "LayerFactory" macros.
  • Constructor Details

    • Layer

      protected Layer(long addr)
  • Method Details

    • __fromPtr__

      public static Layer __fromPtr__(long addr)
    • finalize

      public void finalize(List<Mat> inputs, List<Mat> outputs)
      Computes and sets internal parameters according to inputs, outputs and blobs.
      Parameters:
      inputs - automatically generated
      outputs - vector of already allocated output blobs This method is called after network has allocated all memory for input and output blobs and before inferencing.
    • run

      @Deprecated public void run(List<Mat> inputs, List<Mat> outputs, List<Mat> internals)
      Deprecated.
      This method will be removed in the future release.
      Allocates layer and computes output.
      Parameters:
      inputs - automatically generated
      outputs - automatically generated
      internals - automatically generated
    • outputNameToIndex

      public int outputNameToIndex(String outputName)
      Returns index of output blob in output array. SEE: inputNameToIndex()
      Parameters:
      outputName - automatically generated
      Returns:
      automatically generated
    • get_blobs

      public List<Mat> get_blobs()
    • set_blobs

      public void set_blobs(List<Mat> blobs)
    • get_name

      public String get_name()
    • get_type

      public String get_type()
    • get_preferableTarget

      public int get_preferableTarget()
    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Algorithm
      Throws:
      Throwable