Interface FeatureConverter

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:
DenseFeatureConverter, ImageConverter

public interface FeatureConverter extends com.oracle.labs.mlrg.olcut.config.Configurable, com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>, Serializable
Transforms an Example or SGDVector, extracting the features from it as a TensorMap.

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

N.B. TensorFlow support is experimental and may change without a major version bump.

  • Method Details

    • convert

      TensorMap convert(Example<?> example, ImmutableFeatureMap featureIDMap)
      Converts an Example into a TensorMap 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 TensorMap (similar to a TF Python feed_dict) representing the features in this example.
    • convert

      TensorMap convert(List<? extends Example<?>> example, ImmutableFeatureMap featureIDMap)
      Converts a batch of Examples into a single TensorMap 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 TensorMap (similar to a TF Python feed_dict) representing the features in this minibatch.
    • convert

      TensorMap convert(SGDVector vector)
      Converts a SGDVector representing the features into a TensorMap.

      It generates it as a single example minibatch.

      Parameters:
      vector - The features to convert.
      Returns:
      A TensorMap (similar to a TF Python feed_dict) representing this vector.
    • convert

      TensorMap convert(List<? extends SGDVector> vectors)
      Converts a list of SGDVectors representing a batch of features into a TensorMap.
      Parameters:
      vectors - The batch of features to convert.
      Returns:
      A TensorMap (similar to a TF Python feed_dict) representing this minibatch.
    • inputNamesSet

      Set<String> inputNamesSet()
      Gets a view of the names of the inputs this converter produces.
      Returns:
      The input names.