Interface ExampleTransformer<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:
DenseTransformer, ImageTransformer

public interface ExampleTransformer<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.

Transforms an Example, extracting the features from it as a Tensor.

This usually densifies the example, so can be a lot larger than the input example.

  • Method Summary

    Modifier and Type
    Method
    Description
    org.tensorflow.Tensor<?>
    transform(List<Example<T>> example, ImmutableFeatureMap featureIDMap)
    Converts a batch of Examples into a single Tensor suitable for supplying as an input to a graph.
    org.tensorflow.Tensor<?>
    Converts a list of SparseVectors representing a batch of features into a Tensor.
    org.tensorflow.Tensor<?>
    transform(Example<T> example, ImmutableFeatureMap featureIDMap)
    Converts an Example into a Tensor suitable for supplying as an input to a graph.
    org.tensorflow.Tensor<?>
    Converts a SparseVector representing the features into a Tensor.

    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

    • transform

      org.tensorflow.Tensor<?> transform(Example<T> example, ImmutableFeatureMap featureIDMap)
      Converts an Example into a Tensor suitable for supplying as an input to a graph.

      It generates it as a single example minibatch.

      Parameters:
      example - The example to convert.
      featureIDMap - The id map to convert feature names into id numbers.
      Returns:
      A dense Tensor representing this example.
    • transform

      org.tensorflow.Tensor<?> transform(List<Example<T>> example, ImmutableFeatureMap featureIDMap)
      Converts a batch of Examples into a single Tensor suitable for supplying as an input to a graph.
      Parameters:
      example - The examples to convert.
      featureIDMap - THe id map to convert feature names into id numbers.
      Returns:
      A dense Tensor representing this minibatch.
    • transform

      org.tensorflow.Tensor<?> transform(SparseVector vector)
      Converts a SparseVector representing the features into a Tensor.

      It generates it as a single example minibatch.

      Parameters:
      vector - The features to convert.
      Returns:
      A dense Tensor representing this vector.
    • transform

      org.tensorflow.Tensor<?> transform(List<SparseVector> vectors)
      Converts a list of SparseVectors representing a batch of features into a Tensor.

      Parameters:
      vectors - The batch of features to convert.
      Returns:
      A dense Tensor representing this minibatch.