public class LabelTransformer extends Object implements OutputTransformer<Label>
Label
into a Tensor
containing a 32-bit integer and
can convert a vector of 32-bit floats into a Prediction
or a Label
.Constructor and Description |
---|
LabelTransformer() |
Modifier and Type | Method and Description |
---|---|
boolean |
generatesProbabilities()
Does this OutputTransformer generate probabilities.
|
com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance |
getProvenance() |
String |
toString() |
org.tensorflow.Tensor<?> |
transform(Label example,
ImmutableOutputInfo<Label> outputIDInfo)
Converts an
Output into a Tensor representing it's output. |
org.tensorflow.Tensor<?> |
transform(List<Example<Label>> examples,
ImmutableOutputInfo<Label> outputIDInfo)
Converts a list of
Example into a Tensor representing all the outputs
in the list. |
List<Label> |
transformToBatchOutput(org.tensorflow.Tensor<?> tensor,
ImmutableOutputInfo<Label> outputIDInfo)
Converts a
Tensor containing multiple outputs into a list of Output s. |
List<Prediction<Label>> |
transformToBatchPrediction(org.tensorflow.Tensor<?> tensor,
ImmutableOutputInfo<Label> outputIDInfo,
int[] numValidFeatures,
List<Example<Label>> examples)
Converts a
Tensor containing multiple outputs into a list of Prediction s. |
Label |
transformToOutput(org.tensorflow.Tensor<?> tensor,
ImmutableOutputInfo<Label> outputIDInfo)
Converts a
Tensor into the specified output type. |
Prediction<Label> |
transformToPrediction(org.tensorflow.Tensor<?> tensor,
ImmutableOutputInfo<Label> outputIDInfo,
int numValidFeatures,
Example<Label> example)
Converts a
Tensor into a Prediction . |
public Prediction<Label> transformToPrediction(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<Label> outputIDInfo, int numValidFeatures, Example<Label> example)
OutputTransformer
Tensor
into a Prediction
.transformToPrediction
in interface OutputTransformer<Label>
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.public Label transformToOutput(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<Label> outputIDInfo)
OutputTransformer
Tensor
into the specified output type.transformToOutput
in interface OutputTransformer<Label>
tensor
- The tensor to convert.outputIDInfo
- The output info to use to identify the outputs.public List<Prediction<Label>> transformToBatchPrediction(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<Label> outputIDInfo, int[] numValidFeatures, List<Example<Label>> examples)
OutputTransformer
Tensor
containing multiple outputs into a list of Prediction
s.transformToBatchPrediction
in interface OutputTransformer<Label>
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.public List<Label> transformToBatchOutput(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<Label> outputIDInfo)
OutputTransformer
Tensor
containing multiple outputs into a list of Output
s.transformToBatchOutput
in interface OutputTransformer<Label>
tensor
- The tensor to convert.outputIDInfo
- The output info to use to identify the outputs.public org.tensorflow.Tensor<?> transform(Label example, ImmutableOutputInfo<Label> outputIDInfo)
OutputTransformer
Output
into a Tensor
representing it's output.transform
in interface OutputTransformer<Label>
example
- The output to convert.outputIDInfo
- The output info to use to identify the outputs.public org.tensorflow.Tensor<?> transform(List<Example<Label>> examples, ImmutableOutputInfo<Label> outputIDInfo)
OutputTransformer
Example
into a Tensor
representing all the outputs
in the list. It accepts a list of Example rather than a list of Output for efficiency reasons.transform
in interface OutputTransformer<Label>
examples
- The examples to convert.outputIDInfo
- The output info to use to identify the outputs.public boolean generatesProbabilities()
OutputTransformer
generatesProbabilities
in interface OutputTransformer<Label>
Prediction
.public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()
getProvenance
in interface com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.