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 Details

    • transformToPrediction

      Prediction<T> transformToPrediction(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<T> outputIDInfo, int numValidFeatures, Example<T> example)
      Converts a Tensor into a Prediction.
      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

      T transformToOutput(org.tensorflow.Tensor<?> tensor, ImmutableOutputInfo<T> outputIDInfo)
      Converts a Tensor 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 a Tensor containing multiple outputs into a list of Predictions.
      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 a Tensor containing multiple outputs into a list of Outputs.
      Parameters:
      tensor - The tensor to convert.
      outputIDInfo - The output info to use to identify the outputs.
      Returns:
      A list of outputs.
    • transform

      org.tensorflow.Tensor<?> transform(T output, ImmutableOutputInfo<T> outputIDInfo)
      Converts an Output into a Tensor 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

      org.tensorflow.Tensor<?> transform(List<Example<T>> examples, ImmutableOutputInfo<T> outputIDInfo)
      Converts a list of 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.
      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

      Does this OutputTransformer generate probabilities.
      Returns:
      True if it produces a probability distribution in the Prediction.