Class GenericModelWorker
java.lang.Object
rawDeepLearningClassifier.dlClassification.genericModel.DLModelWorker<StandardPrediction>
rawDeepLearningClassifier.dlClassification.genericModel.GenericModelWorker
- Direct Known Subclasses:
ArchiveModelWorker
Generic model worker.
- 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.genericmodel.GenericModelgetModel()Generic model.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 genericParams, DLControl dlControl) Prepare the model for running.float[]runModel(float[][][] transformedDataStack) Run the model on a stack of transformed data.protected voidsetWaveFreqModel(StandardModelParams genericParams) Methods inherited from class rawDeepLearningClassifier.dlClassification.genericModel.DLModelWorker
dataUnits2ModelInput, getModelTransforms, isEnableSoftMax, model2DLTransforms, runModel, setEnableSoftMax, setModelTransforms
-
Constructor Details
-
GenericModelWorker
public GenericModelWorker()
-
-
Method Details
-
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.
-
prepModel
Description copied from class:DLModelWorkerPrepare the model for running.- Specified by:
prepModelin classDLModelWorker<StandardPrediction>- Parameters:
genericParams- - the parameters for the sound spot model.dlControl- - the control object for the deep learning process.- Returns:
- a status of the preparation of the model.
-
setWaveFreqModel
-
closeModel
public void closeModel()Description copied from class:DLModelWorkerDestroy the model.- Specified by:
closeModelin classDLModelWorker<StandardPrediction>
-
getModel
public org.jamdev.jdl4pam.genericmodel.GenericModel getModel()Generic model.- Returns:
- the generic model.
-
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.
-