public class ImageConverter extends Object implements FeatureConverter
[0,0,0] = 0, [0,0,1] = 1, [0,1,0] = k, [1,0,0] = j*k, ..., [i,0,0] = i*j*k,That is, they are in multidimensional row major order (e.g. the order used by
IDXDataSource
).Constructor and Description |
---|
ImageConverter(String inputName,
int width,
int height,
int channels)
Builds an image converter for images of the supplied size.
|
Modifier and Type | Method and Description |
---|---|
TensorMap |
convert(Example<?> example,
ImmutableFeatureMap featureIDMap)
Transform implicitly pads unseen values with zero.
|
TensorMap |
convert(List<? extends Example<?>> examples,
ImmutableFeatureMap featureIDMap)
Transform implicitly pads unseen values with zero.
|
TensorMap |
convert(List<? extends SGDVector> vectors)
|
TensorMap |
convert(SGDVector vector)
|
com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance |
getProvenance() |
Set<String> |
inputNamesSet()
Gets a view of the names of the inputs this converter produces.
|
void |
postConfig()
Used by the OLCUT configuration system, and should not be called by external code.
|
String |
toString() |
public ImageConverter(String inputName, int width, int height, int channels)
inputName
- The input name.width
- The image width.height
- The image height.channels
- The number of colour channels.public void postConfig()
postConfig
in interface com.oracle.labs.mlrg.olcut.config.Configurable
public Set<String> inputNamesSet()
FeatureConverter
inputNamesSet
in interface FeatureConverter
public TensorMap convert(Example<?> example, ImmutableFeatureMap featureIDMap)
convert
in interface FeatureConverter
example
- The example to transform.featureIDMap
- The feature id mapping to use.public TensorMap convert(List<? extends Example<?>> examples, ImmutableFeatureMap featureIDMap)
Converts a batch of examples into a Tensor.
convert
in interface FeatureConverter
examples
- The examples to transform.featureIDMap
- The feature id mapping to use.public TensorMap convert(SGDVector vector)
FeatureConverter
SGDVector
representing the features into a TensorMap
.
It generates it as a single example minibatch.
convert
in interface FeatureConverter
vector
- The features to convert.public TensorMap convert(List<? extends SGDVector> vectors)
FeatureConverter
convert
in interface FeatureConverter
vectors
- The batch of features to convert.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.