Combines consecutive elements of this dataset into batches.

Combines consecutive elements of this dataset into batches.

dataset_batch(dataset, batch_size, drop_remainder = FALSE)

Arguments

dataset

A dataset

batch_size

An integer, representing the number of consecutive elements of this dataset to combine in a single batch.

drop_remainder

Ensure that batches have a fixed size by omitting any final smaller batch if it's present. Note that this is required for use with the Keras tensor inputs to fit/evaluate/etc.

Value

A dataset

See also