Help protect the Great Barrier Reef with TensorFlow on Kaggle Join Challenge


DataLoader for image classifier.

Used in the notebooks

Used in the tutorials

dataset A object that contains a potentially large set of elements, where each element is a pair of (input_data, target). The input_data means the raw input data, like an image, a text etc., while the target means some ground truth of the raw input data, such as the classification label of the image etc.
size The size of the dataset. donesn't support a function to get the length directly since it's lazy-loaded and may be infinite.




Image analysis for image classification load images with labels.

Assume the image data of the same label are in the same subdirectory.

filename Name of the file.
shuffle boolean, if shuffle, random shuffle data.

ImageDataset containing images and labels and other related info.


Loads data from tensorflow_datasets.


Generate a shared and batched for training/evaluation.

batch_size A integer, the returned dataset will be batched by this size.
is_training A boolean, when True, the returned dataset will be optionally shuffled and repeated as an endless dataset.
shuffle A boolean, when True, the returned dataset will be shuffled to create randomness during model training.
input_pipeline_context A InputContext instance, used to shared dataset among multiple workers when distribution strategy is used.
preprocess A function taking three arguments in order, feature, label and boolean is_training.
drop_remainder boolean, whether the finaly batch drops remainder.

A TF dataset ready to be consumed by Keras model.


Splits dataset into two sub-datasets with the given fraction.

Primarily used for splitting the data set into training and testing sets.

fraction float, demonstrates the fraction of the first returned subdataset in the original data.

The splitted two sub datasets.