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

name

Name of the field

Type:

str

sequence

If True, the field represents a sequence.

Used for tf.Example message serialization : if sequence is True, the field with be stored in the feature_list entry of a tf.train.SequenceExample.

Automatically set if not given : True if shape’s first dimension is None.

Type:

bool

shape

Shape of the field

Type:

Tuple

__init__(name, shape, dtype, default=None, sequence=None)[source]

Methods

__init__(name, shape, dtype[, default, sequence])

as_placeholder([batch])

rtype:

placeholder

is_featurizable()

rtype:

bool

is_sparse()

rtype:

bool

startswith(prefix)

to_feature(value)

Convert value to tf.train.Feature or tf.train.FeatureList.

Attributes

batch_shape

feature_specs

Return feature specs for parsing Example messages.