public class TensorflowCheckpointModel<T extends Output<T>> extends Model<T> implements Closeable
This model encapsulates a simple model with a single input tensor (labelled TensorflowModel.INPUT_NAME
),
and produces a single output tensor (labelled TensorflowModel.OUTPUT_NAME
).
It accepts an ExampleTransformer
that converts an example's features into a Tensor
, and an
OutputTransformer
that converts a Tensor
into a Prediction
.
The model's serialVersionUID is set to the major Tensorflow version number times 100.
N.B. Tensorflow support is experimental and may change without a major version bump.
ALL_OUTPUTS, BIAS_FEATURE, featureIDMap, generatesProbabilities, name, outputIDInfo, provenance, provenanceOutput
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected TensorflowCheckpointModel<T> |
copy(String newName,
ModelProvenance newProvenance)
Copies a model, replacing it's provenance and name with the supplied values.
|
Optional<Excuse<T>> |
getExcuse(Example<T> example)
Deep learning models don't do excuses.
|
Map<String,List<com.oracle.labs.mlrg.olcut.util.Pair<String,Double>>> |
getTopFeatures(int n)
Deep learning models don't do feature rankings.
|
Prediction<T> |
predict(Example<T> example)
Uses the model to predict the output for a single example.
|
copy, generatesProbabilities, getExcuses, getFeatureIDMap, getName, getOutputIDInfo, getProvenance, innerPredict, predict, predict, setName, toString, validate
public Prediction<T> predict(Example<T> example)
Model
predict does not mutate the example.
Throws IllegalArgumentException
if the example has no features
or no feature overlap with the model.
public Map<String,List<com.oracle.labs.mlrg.olcut.util.Pair<String,Double>>> getTopFeatures(int n)
This method always returns the empty map.
getTopFeatures
in class Model<T extends Output<T>>
n
- the number of features to return.public Optional<Excuse<T>> getExcuse(Example<T> example)
This method always returns Optional.empty()
.
protected TensorflowCheckpointModel<T> copy(String newName, ModelProvenance newProvenance)
Model
Used to provide the provenance removal functionality.
public void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.