Class DLModelWorker<T>
java.lang.Object
rawDeepLearningClassifier.dlClassification.genericModel.DLModelWorker<T>
- Direct Known Subclasses:
 GenericModelWorker,KetosWorker,SoundSpotWorker
Runs the deep learning model and performs feature extraction.
 
- Author:
 - Jamie Macaulay
 
- 
Field Summary
Fields - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionabstract voidDestroy the model.float[][][]dataUnits2ModelInput(ArrayList<? extends PamDataUnit> dataUnits, float sampleRate, int iChan) Convert a list of data units to a stack if images.ArrayList<org.jamdev.jdl4pam.transforms.DLTransform> booleanCheck whether the results are normalised with a softmax function.abstract booleanCheck whether a model is null or not.abstract TmakeModelResult(float[] prob, double time) 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.abstract DLStatusprepModel(StandardModelParams soundSpotParams, DLControl dlControl) abstract float[]runModel(float[][][] transformedDataStack) runModel(ArrayList<? extends PamDataUnit> dataUnits, float sampleRate, int iChan) Run the initial data feature extraction and the modelvoidsetEnableSoftMax(boolean enableSoftMax) Set whether the results are normalised with a softmax function.voidsetModelTransforms(ArrayList<org.jamdev.jdl4pam.transforms.DLTransform> modelTransforms)  
- 
Field Details
- 
MAX_QUEUE_SIZE
public static final int MAX_QUEUE_SIZEThe 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 rateiChan- - 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 separately.- 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
 - 
prepModel
 - 
closeModel
public abstract void closeModel()Destroy the model. - 
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
 
 -