Class ImageTransformer<T extends Output<T>>
java.lang.Object
org.tribuo.interop.tensorflow.ImageTransformer<T>
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable,com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>,Serializable,ExampleTransformer<T>
Image transformer. Assumes the feature id numbers are linearised ids of the form
[0,0,0] = 0, [1,0,0] = 1, ..., [i,0,0] = i, [0,1,0] = i+1, ..., [i,j,0] = i*j, ...
[0,0,1] = (i*j)+1, ..., [i,j,k] = i*j*k.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenancevoidUsed by the OLCUT configuration system, and should not be called by external code.toString()org.tensorflow.Tensor<?> transform(List<Example<T>> examples, ImmutableFeatureMap featureIDMap) Transform implicitly pads unseen values with zero.org.tensorflow.Tensor<?> transform(List<SparseVector> vectors) Converts a list ofSparseVectors representing a batch of features into aTensor.org.tensorflow.Tensor<?> transform(Example<T> example, ImmutableFeatureMap featureIDMap) Transform implicitly pads unseen values with zero.org.tensorflow.Tensor<?> transform(SparseVector vector) Converts aSparseVectorrepresenting the features into aTensor.
-
Constructor Details
-
ImageTransformer
-
-
Method Details
-
postConfig
Used by the OLCUT configuration system, and should not be called by external code.- Specified by:
postConfigin interfacecom.oracle.labs.mlrg.olcut.config.Configurable
-
transform
Transform implicitly pads unseen values with zero.- Specified by:
transformin interfaceExampleTransformer<T extends Output<T>>- Parameters:
example- The example to transform.featureIDMap- The feature id mapping to use.- Returns:
- A 3d tensor, (width, height, channels) for this example.
-
transform
public org.tensorflow.Tensor<?> transform(List<Example<T>> examples, ImmutableFeatureMap featureIDMap) Transform implicitly pads unseen values with zero.Converts a batch of examples into a Tensor.
- Specified by:
transformin interfaceExampleTransformer<T extends Output<T>>- Parameters:
examples- The examples to transform.featureIDMap- The feature id mapping to use.- Returns:
- A 4d tensor, (batch-id, width, height, channels) for this example.
-
transform
Description copied from interface:ExampleTransformerConverts aSparseVectorrepresenting the features into aTensor.It generates it as a single example minibatch.
- Specified by:
transformin interfaceExampleTransformer<T extends Output<T>>- Parameters:
vector- The features to convert.- Returns:
- A dense Tensor representing this vector.
-
transform
Description copied from interface:ExampleTransformerConverts a list ofSparseVectors representing a batch of features into aTensor.- Specified by:
transformin interfaceExampleTransformer<T extends Output<T>>- Parameters:
vectors- The batch of features to convert.- Returns:
- A dense Tensor representing this minibatch.
-
toString
-
getProvenance
-