deepr.utils.Field
- class deepr.utils.Field(name, shape, dtype, default=None, sequence=None)[source]
Convenient way to define fields for features.
- default
Default value of the field for padding
- Type:
Any
- dtype
Tensorflow type of the field (automatically inferred if string)
- Type:
tf.DType
- sequence
If True, the field represents a sequence.
Used for
tf.Examplemessage serialization : ifsequenceisTrue, the field with be stored in thefeature_listentry of atf.train.SequenceExample.Automatically set if not given :
Trueifshape’s first dimension isNone.- Type:
- shape
Shape of the field
- Type:
Tuple
Methods
__init__(name, shape, dtype[, default, sequence])as_placeholder([batch])- rtype:
placeholder
is_featurizable()- rtype:
is_sparse()- rtype:
startswith(prefix)to_feature(value)Convert value to tf.train.Feature or tf.train.FeatureList.
Attributes
batch_shapefeature_specsReturn feature specs for parsing Example messages.