public class TensorflowSequenceModel<T extends Output<T>> extends SequenceModel<T> implements Closeable
Modifier and Type | Field and Description |
---|---|
protected SequenceExampleTransformer<T> |
exampleTransformer |
protected String |
initOp |
protected SequenceOutputTransformer<T> |
outputTransformer |
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 SequenceExampleTransformer<T extends Output<T>> exampleTransformer
protected final SequenceOutputTransformer<T extends Output<T>> outputTransformer
protected final String initOp
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 Closeable
close
in interface AutoCloseable
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.