Class KetosWorker
java.lang.Object
rawDeepLearningClassifier.dlClassification.genericModel.DLModelWorker<StandardPrediction>
rawDeepLearningClassifier.dlClassification.ketos.KetosWorker
Runs a Ketos deep learning model and performs feature extraction.
- Author:
- Jamie Macaulay
-
Field Summary
Fields inherited from class rawDeepLearningClassifier.dlClassification.genericModel.DLModelWorker
MAX_QUEUE_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDestroy the model.org.jamdev.jdl4pam.ketos.KetosModelgetModel()Get the currently loaded mode.booleanCheck whether a model is null or not.makeModelResult(float[] prob, double time) Make a model result from the probabilities and the time it took to run the model.prepModel(StandardModelParams ketosDLParams, DLControl dlControl) Prepare the modelfloat[]runModel(float[][][] transformedDataStack) Run the model on a stack of transformed data.Methods inherited from class rawDeepLearningClassifier.dlClassification.genericModel.DLModelWorker
dataUnits2ModelInput, getModelTransforms, isEnableSoftMax, model2DLTransforms, runModel, setEnableSoftMax, setModelTransforms
-
Constructor Details
-
KetosWorker
public KetosWorker()SoundSpotWorker constructor.
-
-
Method Details
-
prepModel
Prepare the model- Specified by:
prepModelin classDLModelWorker<StandardPrediction>- Parameters:
ketosDLParams- - the parameters for the sound spot model.dlControl- - the control object for the deep learning process.- Returns:
-
runModel
public float[] runModel(float[][][] transformedDataStack) Description copied from class:DLModelWorkerRun the model on a stack of transformed data.- Specified by:
runModelin classDLModelWorker<StandardPrediction>- Parameters:
transformedDataStack- - the input data for the model where the outer array is the number of input images or wavforms.- Returns:
- the prediction as a flattened array of probabilities for each class.
-
makeModelResult
Description copied from class:DLModelWorkerMake a model result from the probabilities and the time it took to run the model.- Specified by:
makeModelResultin classDLModelWorker<StandardPrediction>- Parameters:
prob- - the probabilities for each class.time- - the time taken to run the model.- Returns:
- a model result object.
-
closeModel
public void closeModel()Destroy the model.- Specified by:
closeModelin classDLModelWorker<StandardPrediction>
-
getModel
public org.jamdev.jdl4pam.ketos.KetosModel getModel()Get the currently loaded mode.- Returns:
- - the currently loaded mode.
-
isModelNull
public boolean isModelNull()Description copied from class:DLModelWorkerCheck whether a model is null or not.- Specified by:
isModelNullin classDLModelWorker<StandardPrediction>- Returns:
- true of the model is null.
-