public class LabelTransformer extends Object implements OutputTransformer<Label>
OnnxValue
into a Prediction
or a Label
.
Accepts both a tuple (tensor,sequence(map(long,float))) and a single tensor. The former is usually produced by scikit-learn or similar, the latter is produced by pytorch.
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() |
List<Label> |
transformToBatchOutput(List<ai.onnxruntime.OnnxValue> tensor,
ImmutableOutputInfo<Label> outputIDInfo)
Converts a
OnnxValue containing multiple outputs into a list of Output s. |
List<Prediction<Label>> |
transformToBatchPrediction(List<ai.onnxruntime.OnnxValue> tensor,
ImmutableOutputInfo<Label> outputIDInfo,
int[] numValidFeatures,
List<Example<Label>> examples)
Converts a
OnnxValue containing multiple outputs into a list of Prediction s. |
Label |
transformToOutput(List<ai.onnxruntime.OnnxValue> tensor,
ImmutableOutputInfo<Label> outputIDInfo)
Converts a
OnnxValue into the specified output type. |
Prediction<Label> |
transformToPrediction(List<ai.onnxruntime.OnnxValue> tensor,
ImmutableOutputInfo<Label> outputIDInfo,
int numValidFeatures,
Example<Label> example)
Converts a
OnnxValue into a Prediction . |
public Prediction<Label> transformToPrediction(List<ai.onnxruntime.OnnxValue> tensor, ImmutableOutputInfo<Label> outputIDInfo, int numValidFeatures, Example<Label> example)
OutputTransformer
OnnxValue
into a Prediction
.transformToPrediction
in interface OutputTransformer<Label>
tensor
- The value 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(List<ai.onnxruntime.OnnxValue> tensor, ImmutableOutputInfo<Label> outputIDInfo)
OutputTransformer
OnnxValue
into the specified output type.transformToOutput
in interface OutputTransformer<Label>
tensor
- The value to convert.outputIDInfo
- The output info to use to identify the outputs.public List<Prediction<Label>> transformToBatchPrediction(List<ai.onnxruntime.OnnxValue> tensor, ImmutableOutputInfo<Label> outputIDInfo, int[] numValidFeatures, List<Example<Label>> examples)
OutputTransformer
OnnxValue
containing multiple outputs into a list of Prediction
s.transformToBatchPrediction
in interface OutputTransformer<Label>
tensor
- The value 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(List<ai.onnxruntime.OnnxValue> tensor, ImmutableOutputInfo<Label> outputIDInfo)
OutputTransformer
OnnxValue
containing multiple outputs into a list of Output
s.transformToBatchOutput
in interface OutputTransformer<Label>
tensor
- The value 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.