TensorFlow Keras Preprocessing Layers & Dataset Performance

Preprocessing Layers Provided

Model Layers v.s. Preprocessing Dataset

preprocessing_layer is a Keras layer like preprocessing.Normalization

Image data augmentation

Custom Data Augmentation

tf.image

Normalizing features

Encoding categorical features via one-hot encoding

Encoding integer categorical features via one-hot encoding

Applying hashing to an integer categorical feature (optional)

TextVectorization

output_mode

n-gram

Encoding text as a dense matrix of ngrams with multi-hot encoding

Encoding text as a dense matrix of ngrams with TF-IDF weighting

cache & prefetch

Source
Source

interleave (parallelizing data extraction)

Modified from source

Parallelizing data transformation

Vectorizing mapping

Map & Cache

Sample Rebalance

Rejection resampling

Credits and References

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store