public class DenseTransformer<T extends Output<T>> extends Object implements ExampleTransformer<T>
Tensor
.Modifier and Type | Field and Description |
---|---|
static int |
THRESHOLD
Feature size beyond which a warning is generated (as ONNX requires dense features and large feature spaces are memory hungry).
|
static int |
WARNING_THRESHOLD
Number of times the feature size warning should be printed.
|
Constructor and Description |
---|
DenseTransformer() |
Modifier and Type | Method and Description |
---|---|
com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance |
getProvenance() |
String |
toString() |
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<?> |
transform(List<Example<T>> examples,
ImmutableFeatureMap featureIDMap)
Converts a batch of
Example s into a single Tensor suitable for supplying as
an input to a graph. |
org.tensorflow.Tensor<?> |
transform(List<SparseVector> vectors)
Converts a list of
SparseVector s representing a batch of features into a Tensor . |
org.tensorflow.Tensor<?> |
transform(SparseVector vector)
Converts a
SparseVector representing the features into a Tensor . |
public static final int THRESHOLD
public static final int WARNING_THRESHOLD
public org.tensorflow.Tensor<?> transform(Example<T> example, ImmutableFeatureMap featureIDMap)
ExampleTransformer
Example
into a Tensor
suitable for supplying as an input to a graph.
It generates it as a single example minibatch.
transform
in interface ExampleTransformer<T extends Output<T>>
example
- The example to convert.featureIDMap
- The id map to convert feature names into id numbers.public org.tensorflow.Tensor<?> transform(List<Example<T>> examples, ImmutableFeatureMap featureIDMap)
ExampleTransformer
Example
s into a single Tensor
suitable for supplying as
an input to a graph.transform
in interface ExampleTransformer<T extends Output<T>>
examples
- The examples to convert.featureIDMap
- THe id map to convert feature names into id numbers.public org.tensorflow.Tensor<?> transform(SparseVector vector)
ExampleTransformer
SparseVector
representing the features into a Tensor
.
It generates it as a single example minibatch.
transform
in interface ExampleTransformer<T extends Output<T>>
vector
- The features to convert.public org.tensorflow.Tensor<?> transform(List<SparseVector> vectors)
ExampleTransformer
SparseVector
s representing a batch of features into a Tensor
.
transform
in interface ExampleTransformer<T extends Output<T>>
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.