Class DenseFeatureConverter
java.lang.Object
org.tribuo.interop.tensorflow.DenseFeatureConverter
- 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,FeatureConverter
Converts a sparse example into a dense float vector, then wraps it in a
TFloat32.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intFeature size beyond which a warning is generated (as TensorFlow requires dense features and large feature spaces are memory hungry).static final intNumber of times the feature size warning should be printed. -
Constructor Summary
ConstructorsConstructorDescriptionDenseFeatureConverter(String inputName) Builds a DenseFeatureConverter, setting the input name. -
Method Summary
Modifier and TypeMethodDescriptionconvert(List<? extends Example<?>> examples, ImmutableFeatureMap featureIDMap) convert(Example<?> example, ImmutableFeatureMap featureIDMap) com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenanceGets a view of the names of the inputs this converter produces.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
-
Field Details
-
THRESHOLD
public static final int THRESHOLDFeature size beyond which a warning is generated (as TensorFlow requires dense features and large feature spaces are memory hungry).- See Also:
-
WARNING_THRESHOLD
public static final int WARNING_THRESHOLDNumber of times the feature size warning should be printed.- See Also:
-
-
Constructor Details
-
DenseFeatureConverter
Builds a DenseFeatureConverter, setting the input name.- Parameters:
inputName- The placeholder input name.
-
-
Method Details
-
convert
Description copied from interface:FeatureConverterConverts anExampleinto aTensorMapsuitable for supplying as an input to a graph.It generates it as a single example minibatch.
- Specified by:
convertin interfaceFeatureConverter- 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
Description copied from interface:FeatureConverter- Specified by:
convertin interfaceFeatureConverter- Parameters:
examples- 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
Description copied from interface:FeatureConverterConverts aSGDVectorrepresenting the features into aTensorMap.It generates it as a single example minibatch.
- Specified by:
convertin interfaceFeatureConverter- Parameters:
vector- The features to convert.- Returns:
- A TensorMap (similar to a TF Python feed_dict) representing this vector.
-
convert
Description copied from interface:FeatureConverter- Specified by:
convertin interfaceFeatureConverter- Parameters:
vectors- The batch of features to convert.- Returns:
- A TensorMap (similar to a TF Python feed_dict) representing this minibatch.
-
inputNamesSet
Description copied from interface:FeatureConverterGets a view of the names of the inputs this converter produces.- Specified by:
inputNamesSetin interfaceFeatureConverter- Returns:
- The input names.
-
toString
-
getProvenance
public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()- Specified by:
getProvenancein interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
-