Skip to content

Commit

Permalink
Keras guides snapshot: Mon, 09 Aug 2021 07:01:49 GMT
Browse files Browse the repository at this point in the history
  • Loading branch information
tfdocsbot committed Aug 9, 2021
1 parent d606019 commit fb351df
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 30 deletions.
55 changes: 29 additions & 26 deletions site/en/guide/keras/preprocessing_layers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -83,56 +83,59 @@
{
"cell_type": "markdown",
"metadata": {
"id": "85f1ef32e744"
"id": "313360fa9024"
},
"source": [
"## Available preprocessing\n",
"\n",
"### Text preprocessing\n",
"\n",
"- `TextVectorization` layer: turns raw strings into an encoded representation that can be\n",
"read by an `Embedding` layer or `Dense` layer.\n",
"- `tf.keras.layers.TextVectorization`: turns raw strings into an encoded\n",
" representation that can be read by an `Embedding` layer or `Dense` layer.\n",
"\n",
"### Numerical features preprocessing\n",
"\n",
"- `Normalization` layer: performs feature-wise normalize of input features.\n",
"- `Discretization` layer: turns continuous numerical features into integer categorical\n",
"features.\n",
"- `tf.keras.layers.Normalization`: performs feature-wise normalize of\n",
" input features.\n",
"- `tf.keras.layers.Discretization`: turns continuous numerical features\n",
" into integer categorical features.\n",
"\n",
"### Categorical features preprocessing\n",
"\n",
"- `CategoryEncoding` layer: turns integer categorical features into one-hot, multi-hot,\n",
"or count dense representations.\n",
"- `Hashing` layer: performs categorical feature hashing, also known as the \"hashing\n",
"trick\".\n",
"- `StringLookup` layer: turns string categorical values an encoded representation that can be\n",
"read by an `Embedding` layer or `Dense` layer.\n",
"- `IntegerLookup` layer: turns integer categorical values into an encoded representation that can be\n",
"read by an `Embedding` layer or `Dense` layer.\n",
"- `tf.keras.layers.CategoryEncoding`: turns integer categorical features\n",
" into one-hot, multi-hot, or count dense representations.\n",
"- `tf.keras.layers.Hashing`: performs categorical feature hashing, also known as\n",
" the \"hashing trick\".\n",
"- `tf.keras.layers.StringLookup`: turns string categorical values an encoded\n",
" representation that can be read by an `Embedding` layer or `Dense` layer.\n",
"- `tf.keras.layers.IntegerLookup`: turns integer categorical values into an\n",
" encoded representation that can be read by an `Embedding` layer or `Dense`\n",
" layer.\n",
"\n",
"\n",
"### Image preprocessing\n",
"\n",
"These layers are for standardizing the inputs of an image model.\n",
"\n",
"- `Resizing` layer: resizes a batch of images to a target size.\n",
"- `Rescaling` layer: rescales and offsets the values of a batch of image (e.g. go from\n",
"inputs in the `[0, 255]` range to inputs in the `[0, 1]` range.\n",
"- `CenterCrop` layer: returns a center crop of a batch of images.\n",
"- `tf.keras.layers.Resizing`: resizes a batch of images to a target size.\n",
"- `tf.keras.layers.Rescaling`: rescales and offsets the values of a batch of\n",
" image (e.g. go from inputs in the `[0, 255]` range to inputs in the `[0, 1]`\n",
" range.\n",
"- `tf.keras.layers.CenterCrop`: returns a center crop of a batch of images.\n",
"\n",
"### Image data augmentation\n",
"\n",
"These layers apply random augmentation transforms to a batch of images. They\n",
"are only active during training.\n",
"\n",
"- `RandomCrop` layer\n",
"- `RandomFlip` layer\n",
"- `RandomTranslation` layer\n",
"- `RandomRotation` layer\n",
"- `RandomZoom` layer\n",
"- `RandomHeight` layer\n",
"- `RandomWidth` layer\n",
"- `RandomContrast` layer"
"- `tf.keras.layers.RandomCrop`\n",
"- `tf.keras.layers.RandomFlip`\n",
"- `tf.keras.layers.RandomTranslation`\n",
"- `tf.keras.layers.RandomRotation`\n",
"- `tf.keras.layers.RandomZoom`\n",
"- `tf.keras.layers.RandomHeight`\n",
"- `tf.keras.layers.RandomWidth`\n",
"- `tf.keras.layers.RandomContrast`"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,14 +359,14 @@
{
"cell_type": "markdown",
"metadata": {
"id": "940d8d9fae83"
"id": "1c9a16c21790"
},
"source": [
"## Speeding-up your training step with `tf.function`\n",
"\n",
"The default runtime in TensorFlow 2.0 is\n",
"[eager execution](https://www.tensorflow.org/guide/eager). As such, our training loop\n",
"above executes eagerly.\n",
"The default runtime in TensorFlow 2 is\n",
"[eager execution](https://www.tensorflow.org/guide/eager).\n",
"As such, our training loop above executes eagerly.\n",
"\n",
"This is great for debugging, but graph compilation has a definite performance\n",
"advantage. Describing your computation as a static graph enables the framework\n",
Expand Down

0 comments on commit fb351df

Please sign in to comment.