Interface OutputTransformer<T extends Output<T>>
- All Superinterfaces:
com.oracle.labs.mlrg.olcut.config.Configurable
,com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
,Serializable
- All Known Implementing Classes:
LabelTransformer
,RegressorTransformer
public interface OutputTransformer<T extends Output<T>>
extends com.oracle.labs.mlrg.olcut.config.Configurable, com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>, Serializable
TensorFlow support is experimental, and may change without a major version bump.
Converts the Output
into a Tensor
and vice versa.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Does this OutputTransformer generate probabilities.org.tensorflow.Tensor
<?> Converts a list ofExample
into aTensor
representing all the outputs in the list.org.tensorflow.Tensor
<?> transform
(T output, ImmutableOutputInfo<T> outputIDInfo) Converts anOutput
into aTensor
representing it's output.transformToBatchOutput
(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<T> outputIDInfo) Converts aTensor
containing multiple outputs into a list ofOutput
s.List
<Prediction<T>> transformToBatchPrediction
(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<T> outputIDInfo, int[] numValidFeatures, List<Example<T>> examples) Converts aTensor
containing multiple outputs into a list ofPrediction
s.transformToOutput
(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<T> outputIDInfo) Converts aTensor
into the specified output type.transformToPrediction
(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<T> outputIDInfo, int numValidFeatures, Example<T> example) Converts aTensor
into aPrediction
.Methods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
Methods inherited from interface com.oracle.labs.mlrg.olcut.provenance.Provenancable
getProvenance
-
Method Details
-
transformToPrediction
Prediction<T> transformToPrediction(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<T> outputIDInfo, int numValidFeatures, Example<T> example) Converts aTensor
into aPrediction
.- Parameters:
tensor
- The tensor to convert.outputIDInfo
- The output info to use to identify the outputs.numValidFeatures
- The number of valid features used by the prediction.example
- The example to insert into the prediction.- Returns:
- A prediction object.
-
transformToOutput
Converts aTensor
into the specified output type.- Parameters:
tensor
- The tensor to convert.outputIDInfo
- The output info to use to identify the outputs.- Returns:
- A output.
-
transformToBatchPrediction
List<Prediction<T>> transformToBatchPrediction(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<T> outputIDInfo, int[] numValidFeatures, List<Example<T>> examples) Converts aTensor
containing multiple outputs into a list ofPrediction
s.- Parameters:
tensor
- The tensor to convert.outputIDInfo
- The output info to use to identify the outputs.numValidFeatures
- The number of valid features used by the prediction.examples
- The example to insert into the prediction.- Returns:
- A list of predictions.
-
transformToBatchOutput
List<T> transformToBatchOutput(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<T> outputIDInfo) Converts aTensor
containing multiple outputs into a list ofOutput
s.- Parameters:
tensor
- The tensor to convert.outputIDInfo
- The output info to use to identify the outputs.- Returns:
- A list of outputs.
-
transform
Converts anOutput
into aTensor
representing it's output.- Parameters:
output
- The output to convert.outputIDInfo
- The output info to use to identify the outputs.- Returns:
- A Tensor representing this output.
-
transform
Converts a list ofExample
into aTensor
representing all the outputs in the list. It accepts a list of Example rather than a list of Output for efficiency reasons.- Parameters:
examples
- The examples to convert.outputIDInfo
- The output info to use to identify the outputs.- Returns:
- A Tensor representing all the supplied Outputs.
-
generatesProbabilities
boolean generatesProbabilities()Does this OutputTransformer generate probabilities.- Returns:
- True if it produces a probability distribution in the
Prediction
.
-