public class NNExampleModelDetector extends TrainedModelDetector
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
EXAMPLE_NNMODEL_FILE |
private static java.util.logging.Logger |
log |
private static long |
serialVersionUID |
Constructor and Description |
---|
NNExampleModelDetector() |
NNExampleModelDetector(java.io.File modelFile) |
NNExampleModelDetector(java.nio.file.Path modelFile) |
Modifier and Type | Method and Description |
---|---|
void |
loadDefaultModels(java.lang.ClassLoader classLoader)
this method gets overwritten to register load neural network models
|
void |
loadDefaultModels(java.io.InputStream modelStream) |
private void |
readDescription(NNTrainedModelBuilder builder,
java.lang.String line)
read the comments where the model configuration is written, e.g the
number of inputs, hiddens and output please ensure the first char in the
given string is # In this example grb model file, there are 4 elements 1)
type 2) number of input units 3) number of hidden units.
|
private void |
readNNParams(NNTrainedModelBuilder builder,
java.lang.String line)
Read the next line for the model parameters and populate the build which
later will be used to instantiate the instance of TrainedModel
|
detect, getMinLength, loadDefaultModels, loadDefaultModels, readByteFrequencies, registerModels
private static final java.lang.String EXAMPLE_NNMODEL_FILE
private static final long serialVersionUID
private static final java.util.logging.Logger log
public NNExampleModelDetector()
public NNExampleModelDetector(java.nio.file.Path modelFile)
public NNExampleModelDetector(java.io.File modelFile)
public void loadDefaultModels(java.io.InputStream modelStream)
loadDefaultModels
in class TrainedModelDetector
public void loadDefaultModels(java.lang.ClassLoader classLoader)
loadDefaultModels
in class TrainedModelDetector
private void readDescription(NNTrainedModelBuilder builder, java.lang.String line)
private void readNNParams(NNTrainedModelBuilder builder, java.lang.String line)
builder
- line
-