deepr.prepros.PaddedBatch
- class deepr.prepros.PaddedBatch(batch_size, fields, drop_remainder=False)[source]
Combines consecutive elements of a dataset into padded batches.
NOTE: this applies on dataset yielding dictionaries ONLY.
If you want to create padded batches from other structures, you need to create your own padded batch prepro wrapping the tensorflow implementation. For example:
@deepr.prepros.prepro def PaddedBatchDefault(dataset, batch_size, padded_shapes, padding_values): return dataset.padded_batch(bath_size, padded_shapes, padding_values)
- modes
Active modes for the map (will skip modes not in modes). Default is None (all modes are considered active modes).
- Type:
Iterable[str], Optional
Methods
__init__
(batch_size, fields[, drop_remainder])apply
(dataset[, mode])Pre-process a dataset