java.lang.Object
rawDeepLearningClassifier.dlClassification.genericModel.DLModelWorker<T>
Direct Known Subclasses:
GenericModelWorker, KetosWorker, SoundSpotWorker

public abstract class DLModelWorker<T> extends Object
Runs the deep learning model and performs feature extraction.

Author:
Jamie Macaulay
  • Field Details

    • MAX_QUEUE_SIZE

      public static final int MAX_QUEUE_SIZE
      The maximum allowed queue size;
      See Also:
  • Constructor Details

    • DLModelWorker

      public DLModelWorker()
  • Method Details

    • dataUnits2ModelInput

      public float[][][] dataUnits2ModelInput(ArrayList<? extends PamDataUnit> dataUnits, float sampleRate, int iChan)
      Convert a list of data units to a stack if images.
      Parameters:
      dataUnits - - the data units.
      sampleRate - - the sample rate
      iChan - - the channels
      Returns:
      a stack of images for input into a deep learning model.
    • runModel

      public ArrayList<T> runModel(ArrayList<? extends PamDataUnit> dataUnits, float sampleRate, int iChan)
      Run the initial data feature extraction and the model
      Parameters:
      iChan - - the channel to run the data on.
      rawDataUnit - - the raw data unit. This is a stack of data units to be classified either together or seperately.
      Returns:
      the model to run.
    • runModel

      public abstract float[] runModel(float[][][] transformedDataStack)
    • isModelNull

      public abstract boolean isModelNull()
      Check whether a model is null or not.
      Returns:
      true of the model is null.
    • makeModelResult

      public abstract T makeModelResult(float[] prob, double time)
    • prepModel

      public abstract void prepModel(StandardModelParams soundSpotParams, DLControl dlControl)
    • closeModel

      public abstract void closeModel()
      Destroy the model.
    • getModelTransforms

      public ArrayList<org.jamdev.jdl4pam.transforms.DLTransform> getModelTransforms()
    • setModelTransforms

      public void setModelTransforms(ArrayList<org.jamdev.jdl4pam.transforms.DLTransform> modelTransforms)
    • model2DLTransforms

      public ArrayList<org.jamdev.jdl4pam.transforms.DLTransform> model2DLTransforms(org.jamdev.jdl4pam.animalSpot.AnimalSpotParams dlParams)
      Convert the parameters saved in the sound spot model to DLtransform parameters.
      Returns:
      the DLTransform parameters.
    • isEnableSoftMax

      public boolean isEnableSoftMax()
      Check whether the results are normalised with a softmax function.
      Returns:
      true if results are normalised using a softmax function
    • setEnableSoftMax

      public void setEnableSoftMax(boolean enableSoftMax)
      Set whether the results are normalised with a softmax function.
      Parameters:
      set - to true if results are normalised using a softmax function