public class DenseFeatureConverter extends Object implements FeatureConverter
TFloat32
.Modifier and Type | Field and Description |
---|---|
static int |
THRESHOLD
Feature size beyond which a warning is generated (as TensorFlow 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 |
---|
DenseFeatureConverter(String inputName)
Builds a DenseFeatureConverter, setting the input name.
|
Modifier and Type | Method and Description |
---|---|
TensorMap |
convert(Example<?> example,
ImmutableFeatureMap featureIDMap)
|
TensorMap |
convert(List<? extends Example<?>> examples,
ImmutableFeatureMap featureIDMap)
|
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.
|
String |
toString() |
public static final int THRESHOLD
public static final int WARNING_THRESHOLD
public DenseFeatureConverter(String inputName)
inputName
- The placeholder input name.public TensorMap convert(Example<?> example, ImmutableFeatureMap featureIDMap)
FeatureConverter
Example
into a TensorMap
suitable for supplying as an input to a graph.
It generates it as a single example minibatch.
convert
in interface FeatureConverter
example
- The example to convert.featureIDMap
- The id map to convert feature names into id numbers.public TensorMap convert(List<? extends Example<?>> examples, ImmutableFeatureMap featureIDMap)
FeatureConverter
convert
in interface FeatureConverter
examples
- The examples to convert.featureIDMap
- THe id map to convert feature names into id numbers.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 Set<String> inputNamesSet()
FeatureConverter
inputNamesSet
in interface FeatureConverter
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.