From 3e60165083f99e95cfaa2c38f2fea052ebe340f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franc=CC=A7ois=20Chollet?= Date: Wed, 30 Jun 2021 09:45:22 -0700 Subject: [PATCH] Update preprocessing guide --- guides/ipynb/preprocessing_layers.ipynb | 3 ++- guides/md/preprocessing_layers.md | 21 +++++++++++---------- guides/preprocessing_layers.py | 1 + 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/guides/ipynb/preprocessing_layers.ipynb b/guides/ipynb/preprocessing_layers.ipynb index 17421be7fa..42027bfaec 100644 --- a/guides/ipynb/preprocessing_layers.ipynb +++ b/guides/ipynb/preprocessing_layers.ipynb @@ -83,7 +83,8 @@ "- `RandomRotation` layer\n", "- `RandomZoom` layer\n", "- `RandomHeight` layer\n", - "- `RandomWidth` layer" + "- `RandomWidth` layer\n", + "- `RandomContrast` layer" ] }, { diff --git a/guides/md/preprocessing_layers.md b/guides/md/preprocessing_layers.md index 2f254a7968..0af975d688 100644 --- a/guides/md/preprocessing_layers.md +++ b/guides/md/preprocessing_layers.md @@ -69,6 +69,7 @@ are only active during training. - `RandomZoom` layer - `RandomHeight` layer - `RandomWidth` layer +- `RandomContrast` layer --- ## The `adapt()` method @@ -293,9 +294,9 @@ model.fit(train_dataset, steps_per_epoch=5)
``` -5/5 [==============================] - 12s 576ms/step - loss: 8.7839 +5/5 [==============================] - 23s 931ms/step - loss: 9.5173 - + ```
@@ -329,9 +330,9 @@ model.fit(x_train, y_train)
``` -1563/1563 [==============================] - 2s 910us/step - loss: 2.1323 +1563/1563 [==============================] - 4s 2ms/step - loss: 2.1302 - + ```
@@ -505,14 +506,14 @@ Encoded text:
``` Training model... -1/1 [==============================] - 2s 2s/step - loss: 0.5292 +1/1 [==============================] - 4s 4s/step - loss: 0.4916 ```
``` Calling end-to-end model on test string... -Model output: tf.Tensor([[0.01447889]], shape=(1, 1), dtype=float32) +Model output: tf.Tensor([[0.02326627]], shape=(1, 1), dtype=float32) ```
@@ -590,14 +591,14 @@ Encoded text:
``` Training model... -1/1 [==============================] - 0s 222ms/step - loss: 1.4333 +1/1 [==============================] - 1s 583ms/step - loss: 0.3378 ```
``` Calling end-to-end model on test string... -Model output: tf.Tensor([[-0.89536154]], shape=(1, 1), dtype=float32) +Model output: tf.Tensor([[0.7227254]], shape=(1, 1), dtype=float32) ```
@@ -673,14 +674,14 @@ Encoded text:
``` Training model... -1/1 [==============================] - 0s 216ms/step - loss: 19.4452 +1/1 [==============================] - 1s 551ms/step - loss: 3.5459 ```
``` Calling end-to-end model on test string... -Model output: tf.Tensor([[-0.36555034]], shape=(1, 1), dtype=float32) +Model output: tf.Tensor([[0.51119524]], shape=(1, 1), dtype=float32) ```
diff --git a/guides/preprocessing_layers.py b/guides/preprocessing_layers.py index cb7c61ab9d..4147ca434d 100644 --- a/guides/preprocessing_layers.py +++ b/guides/preprocessing_layers.py @@ -65,6 +65,7 @@ - `RandomZoom` layer - `RandomHeight` layer - `RandomWidth` layer +- `RandomContrast` layer """