deepr.readers package

Submodules

deepr.readers.base module

Abstract base class for reader

class deepr.readers.base.DatasetReader(dataset)[source]

Bases: Reader

Dummy dataset reader initialized with a tf.data.Dataset

as_dataset()[source]

Build a tf.data.Dataset

Return type:

DatasetV1

class deepr.readers.base.Reader[source]

Bases: ABC

Interface for readers, similar to tensorflow_datasets

abstract as_dataset()[source]

Build a tf.data.Dataset

Return type:

DatasetV1

deepr.readers.base.from_dataset(dataset)[source]
Return type:

DatasetReader

deepr.readers.generator module

Reader Class for datasets using generator functions

class deepr.readers.generator.GeneratorReader(generator_fn, output_types, output_shapes=None)[source]

Bases: Reader

Reader Class for datasets using generator functions

generator_fn

Generator function, yields features, labels

Type:

Callable

output_types

Generator outputs dtypes

Type:

Nested structure of tf.DType

output_shapes

Generator outputs shapes

Type:

Nested structure of tf.TensorShape

as_dataset()[source]

Build a tf.data.Dataset

Return type:

DatasetV1

deepr.readers.record module

Class for TFRecord Reader of tf.train.Example

class deepr.readers.record.TFRecordReader(path, num_parallel_reads=8, num_parallel_calls=8, shuffle=True, recursive=True)[source]

Bases: Reader

Class for TFRecord Reader of tf.train.Example.

num_parallel_calls

Description

Type:

TYPE

num_parallel_reads

Number of parallel reads

Type:

int

path

List of filenames or path to directory

Type:

List[Union[str, Path]]

shuffle

Shuffle files if True before reading.

Type:

bool

as_dataset()[source]

Build a tf.data.Dataset

Return type:

DatasetV1

property compression_type
property filenames

Get filenames in path.

deepr.readers.record.bytes_feature(value)[source]

Returns a bytes_list from a string / byte.

deepr.readers.record.float_feature(value)[source]

Returns an float_list from a float

deepr.readers.record.int64_feature(value)[source]

Returns an int64_list from an int

deepr.readers.record.int64_feature_list(values)[source]

Returns a FeatureList from a list of int

Module contents