public class TensorFlowSequenceModel<T extends Output<T>> extends SequenceModel<T> implements AutoCloseable
N.B. TensorFlow support is experimental and may change without a major version bump.
Modifier and Type | Field and Description |
---|---|
protected SequenceFeatureConverter |
featureConverter |
protected SequenceOutputConverter<T> |
outputConverter |
protected String |
predictOp |
featureIDMap, name, outputIDMap, provenanceOutput
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the session and graph if they exist.
|
Map<String,List<com.oracle.labs.mlrg.olcut.util.Pair<String,Double>>> |
getTopFeatures(int i)
Returns an empty map, as the top features are not well defined for most TensorFlow models.
|
List<Prediction<T>> |
predict(SequenceExample<T> example)
Uses the model to predict the output for a single example.
|
getFeatureIDMap, getName, getOutputIDInfo, getProvenance, predict, predict, setName, toMaxLabels, toString, validate
protected final SequenceFeatureConverter featureConverter
protected final SequenceOutputConverter<T extends Output<T>> outputConverter
protected final String predictOp
public List<Prediction<T>> predict(SequenceExample<T> example)
SequenceModel
predict
in class SequenceModel<T extends Output<T>>
example
- the example to predict.public Map<String,List<com.oracle.labs.mlrg.olcut.util.Pair<String,Double>>> getTopFeatures(int i)
getTopFeatures
in class SequenceModel<T extends Output<T>>
i
- the number of features to return. If this value is less than 0,
all features should be returned for each class, unless the model cannot score it's features.public void close()
close
in interface AutoCloseable
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.