diff --git a/guides/_distributed_training.py b/guides/_distributed_training.py index 1499479123..5fbfa116b6 100644 --- a/guides/_distributed_training.py +++ b/guides/_distributed_training.py @@ -6,6 +6,7 @@ Description: Guide to multi-GPU & distributed training for Keras models. Accelerator: GPU """ + """ ## Introduction diff --git a/guides/_preprocessing_layers.py b/guides/_preprocessing_layers.py index 3c91c414b7..e10a4a1fe5 100644 --- a/guides/_preprocessing_layers.py +++ b/guides/_preprocessing_layers.py @@ -6,6 +6,7 @@ Description: Overview of how to leverage preprocessing layers to create end-to-end models. Accelerator: GPU """ + """ ## Keras preprocessing diff --git a/guides/_working_with_rnns.py b/guides/_working_with_rnns.py index b93fdf9909..7f75b94e6f 100644 --- a/guides/_working_with_rnns.py +++ b/guides/_working_with_rnns.py @@ -6,6 +6,7 @@ Description: Complete guide to using & customizing RNN layers. Accelerator: GPU """ + """ ## Introduction diff --git a/guides/distributed_training_with_jax.py b/guides/distributed_training_with_jax.py index 03e64f7424..750592adc5 100644 --- a/guides/distributed_training_with_jax.py +++ b/guides/distributed_training_with_jax.py @@ -6,6 +6,7 @@ Description: Guide to multi-GPU/TPU training for Keras models with JAX. Accelerator: GPU """ + """ ## Introduction diff --git a/guides/distributed_training_with_tensorflow.py b/guides/distributed_training_with_tensorflow.py index ffc86b6d51..d88ec4c089 100644 --- a/guides/distributed_training_with_tensorflow.py +++ b/guides/distributed_training_with_tensorflow.py @@ -6,6 +6,7 @@ Description: Guide to multi-GPU training for Keras models with TensorFlow. Accelerator: GPU """ + """ ## Introduction diff --git a/guides/distributed_training_with_torch.py b/guides/distributed_training_with_torch.py index 5fa31d73c9..db78e1d3d5 100644 --- a/guides/distributed_training_with_torch.py +++ b/guides/distributed_training_with_torch.py @@ -6,6 +6,7 @@ Description: Guide to multi-GPU training for Keras models with PyTorch. Accelerator: GPU """ + """ ## Introduction diff --git a/guides/functional_api.py b/guides/functional_api.py index 0c6d05f744..9840d07736 100644 --- a/guides/functional_api.py +++ b/guides/functional_api.py @@ -6,6 +6,7 @@ Description: Complete guide to the functional API. Accelerator: GPU """ + """ ## Setup """ @@ -402,7 +403,7 @@ def get_model(): """ # Dummy input data -title_data = np.random.randint(num_words, size=(1280, 10)) +title_data = np.random.randint(num_words, size=(1280, 12)) body_data = np.random.randint(num_words, size=(1280, 100)) tags_data = np.random.randint(2, size=(1280, num_tags)).astype("float32") diff --git a/guides/img/functional_api/functional_api_22_0.png b/guides/img/functional_api/functional_api_22_0.png index 07ec0fa7a0..03b743387c 100644 Binary files a/guides/img/functional_api/functional_api_22_0.png and b/guides/img/functional_api/functional_api_22_0.png differ diff --git a/guides/img/functional_api/functional_api_40_0.png b/guides/img/functional_api/functional_api_40_0.png index 7ca56f6d55..3d1090cead 100644 Binary files a/guides/img/functional_api/functional_api_40_0.png and b/guides/img/functional_api/functional_api_40_0.png differ diff --git a/guides/img/functional_api/functional_api_51_0.png b/guides/img/functional_api/functional_api_51_0.png index 35cff2851b..30a0d44822 100644 Binary files a/guides/img/functional_api/functional_api_51_0.png and b/guides/img/functional_api/functional_api_51_0.png differ diff --git a/guides/intro_to_keras_for_engineers.py b/guides/intro_to_keras_for_engineers.py index 22f42ad57b..59baf2b834 100644 --- a/guides/intro_to_keras_for_engineers.py +++ b/guides/intro_to_keras_for_engineers.py @@ -6,6 +6,7 @@ Description: First contact with Keras 3. Accelerator: GPU """ + """ ## Introduction diff --git a/guides/ipynb/functional_api.ipynb b/guides/ipynb/functional_api.ipynb index f0a437af51..63e9befb08 100644 --- a/guides/ipynb/functional_api.ipynb +++ b/guides/ipynb/functional_api.ipynb @@ -723,7 +723,7 @@ "outputs": [], "source": [ "# Dummy input data\n", - "title_data = np.random.randint(num_words, size=(1280, 10))\n", + "title_data = np.random.randint(num_words, size=(1280, 12))\n", "body_data = np.random.randint(num_words, size=(1280, 100))\n", "tags_data = np.random.randint(2, size=(1280, num_tags)).astype(\"float32\")\n", "\n", diff --git a/guides/keras_nlp/getting_started.py b/guides/keras_nlp/getting_started.py index 3718b2b130..263b84b905 100644 --- a/guides/keras_nlp/getting_started.py +++ b/guides/keras_nlp/getting_started.py @@ -6,6 +6,7 @@ Description: An introduction to the KerasNLP API. Accelerator: GPU """ + """ ## Introduction diff --git a/guides/making_new_layers_and_models_via_subclassing.py b/guides/making_new_layers_and_models_via_subclassing.py index aa992a56cf..647bcf111f 100644 --- a/guides/making_new_layers_and_models_via_subclassing.py +++ b/guides/making_new_layers_and_models_via_subclassing.py @@ -6,6 +6,7 @@ Description: Complete guide to writing `Layer` and `Model` objects from scratch. Accelerator: None """ + """ ## Introduction diff --git a/guides/md/functional_api.md b/guides/md/functional_api.md index d84f9891be..91ea0c5cd3 100644 --- a/guides/md/functional_api.md +++ b/guides/md/functional_api.md @@ -145,17 +145,17 @@ model.summary() -
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
-┃ Layer (type)                     Output Shape                  Param # ┃
-┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
-│ input_layer (InputLayer)        │ (None, 784)               │          0 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ dense (Dense)                   │ (None, 64)                │     50,240 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ dense_1 (Dense)                 │ (None, 64)                │      4,160 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ dense_2 (Dense)                 │ (None, 10)                │        650 │
-└─────────────────────────────────┴───────────────────────────┴────────────┘
+
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
+┃ Layer (type)                     Output Shape                  Param # ┃
+┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
+│ input_layer (InputLayer)        │ (None, 784)            │             0 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ dense (Dense)                   │ (None, 64)             │        50,240 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ dense_1 (Dense)                 │ (None, 64)             │         4,160 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ dense_2 (Dense)                 │ (None, 10)             │           650 │
+└─────────────────────────────────┴────────────────────────┴───────────────┘
 
@@ -259,12 +259,12 @@ print("Test accuracy:", test_scores[1])
``` Epoch 1/2 - 750/750 ━━━━━━━━━━━━━━━━━━━━ 1s 543us/step - accuracy: 0.8343 - loss: 0.6052 - val_accuracy: 0.9473 - val_loss: 0.1853 + 750/750 ━━━━━━━━━━━━━━━━━━━━ 1s 863us/step - accuracy: 0.8425 - loss: 0.5733 - val_accuracy: 0.9496 - val_loss: 0.1711 Epoch 2/2 - 750/750 ━━━━━━━━━━━━━━━━━━━━ 0s 373us/step - accuracy: 0.9462 - loss: 0.1814 - val_accuracy: 0.9553 - val_loss: 0.1507 -313/313 - 0s - 292us/step - accuracy: 0.9535 - loss: 0.1525 -Test loss: 0.15254925191402435 -Test accuracy: 0.953499972820282 + 750/750 ━━━━━━━━━━━━━━━━━━━━ 1s 859us/step - accuracy: 0.9509 - loss: 0.1641 - val_accuracy: 0.9578 - val_loss: 0.1396 +313/313 - 0s - 341us/step - accuracy: 0.9613 - loss: 0.1288 +Test loss: 0.12876172363758087 +Test accuracy: 0.9613000154495239 ```
@@ -338,24 +338,24 @@ autoencoder.summary() -
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
-┃ Layer (type)                     Output Shape                  Param # ┃
-┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
-│ img (InputLayer)                │ (None, 28, 28, 1)         │          0 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ conv2d (Conv2D)                 │ (None, 26, 26, 16)        │        160 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ conv2d_1 (Conv2D)               │ (None, 24, 24, 32)        │      4,640 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ max_pooling2d (MaxPooling2D)    │ (None, 8, 8, 32)          │          0 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ conv2d_2 (Conv2D)               │ (None, 6, 6, 32)          │      9,248 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ conv2d_3 (Conv2D)               │ (None, 4, 4, 16)          │      4,624 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ global_max_pooling2d            │ (None, 16)                │          0 │
-│ (GlobalMaxPooling2D)            │                           │            │
-└─────────────────────────────────┴───────────────────────────┴────────────┘
+
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
+┃ Layer (type)                     Output Shape                  Param # ┃
+┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
+│ img (InputLayer)                │ (None, 28, 28, 1)      │             0 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ conv2d (Conv2D)                 │ (None, 26, 26, 16)     │           160 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ conv2d_1 (Conv2D)               │ (None, 24, 24, 32)     │         4,640 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ max_pooling2d (MaxPooling2D)    │ (None, 8, 8, 32)       │             0 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ conv2d_2 (Conv2D)               │ (None, 6, 6, 32)       │         9,248 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ conv2d_3 (Conv2D)               │ (None, 4, 4, 16)       │         4,624 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ global_max_pooling2d            │ (None, 16)             │             0 │
+│ (GlobalMaxPooling2D)            │                        │               │
+└─────────────────────────────────┴────────────────────────┴───────────────┘
 
@@ -385,40 +385,40 @@ autoencoder.summary() -
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
-┃ Layer (type)                     Output Shape                  Param # ┃
-┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
-│ img (InputLayer)                │ (None, 28, 28, 1)         │          0 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ conv2d (Conv2D)                 │ (None, 26, 26, 16)        │        160 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ conv2d_1 (Conv2D)               │ (None, 24, 24, 32)        │      4,640 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ max_pooling2d (MaxPooling2D)    │ (None, 8, 8, 32)          │          0 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ conv2d_2 (Conv2D)               │ (None, 6, 6, 32)          │      9,248 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ conv2d_3 (Conv2D)               │ (None, 4, 4, 16)          │      4,624 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ global_max_pooling2d            │ (None, 16)                │          0 │
-│ (GlobalMaxPooling2D)            │                           │            │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ reshape (Reshape)               │ (None, 4, 4, 1)           │          0 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ conv2d_transpose                │ (None, 6, 6, 16)          │        160 │
-│ (Conv2DTranspose)               │                           │            │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ conv2d_transpose_1              │ (None, 8, 8, 32)          │      4,640 │
-│ (Conv2DTranspose)               │                           │            │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ up_sampling2d (UpSampling2D)    │ (None, 24, 24, 32)        │          0 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ conv2d_transpose_2              │ (None, 26, 26, 16)        │      4,624 │
-│ (Conv2DTranspose)               │                           │            │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ conv2d_transpose_3              │ (None, 28, 28, 1)         │        145 │
-│ (Conv2DTranspose)               │                           │            │
-└─────────────────────────────────┴───────────────────────────┴────────────┘
+
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
+┃ Layer (type)                     Output Shape                  Param # ┃
+┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
+│ img (InputLayer)                │ (None, 28, 28, 1)      │             0 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ conv2d (Conv2D)                 │ (None, 26, 26, 16)     │           160 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ conv2d_1 (Conv2D)               │ (None, 24, 24, 32)     │         4,640 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ max_pooling2d (MaxPooling2D)    │ (None, 8, 8, 32)       │             0 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ conv2d_2 (Conv2D)               │ (None, 6, 6, 32)       │         9,248 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ conv2d_3 (Conv2D)               │ (None, 4, 4, 16)       │         4,624 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ global_max_pooling2d            │ (None, 16)             │             0 │
+│ (GlobalMaxPooling2D)            │                        │               │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ reshape (Reshape)               │ (None, 4, 4, 1)        │             0 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ conv2d_transpose                │ (None, 6, 6, 16)       │           160 │
+│ (Conv2DTranspose)               │                        │               │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ conv2d_transpose_1              │ (None, 8, 8, 32)       │         4,640 │
+│ (Conv2DTranspose)               │                        │               │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ up_sampling2d (UpSampling2D)    │ (None, 24, 24, 32)     │             0 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ conv2d_transpose_2              │ (None, 26, 26, 16)     │         4,624 │
+│ (Conv2DTranspose)               │                        │               │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ conv2d_transpose_3              │ (None, 28, 28, 1)      │           145 │
+│ (Conv2DTranspose)               │                        │               │
+└─────────────────────────────────┴────────────────────────┴───────────────┘
 
@@ -497,24 +497,24 @@ autoencoder.summary() -
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
-┃ Layer (type)                     Output Shape                  Param # ┃
-┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
-│ original_img (InputLayer)       │ (None, 28, 28, 1)         │          0 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ conv2d_4 (Conv2D)               │ (None, 26, 26, 16)        │        160 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ conv2d_5 (Conv2D)               │ (None, 24, 24, 32)        │      4,640 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ max_pooling2d_1 (MaxPooling2D)  │ (None, 8, 8, 32)          │          0 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ conv2d_6 (Conv2D)               │ (None, 6, 6, 32)          │      9,248 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ conv2d_7 (Conv2D)               │ (None, 4, 4, 16)          │      4,624 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ global_max_pooling2d_1          │ (None, 16)                │          0 │
-│ (GlobalMaxPooling2D)            │                           │            │
-└─────────────────────────────────┴───────────────────────────┴────────────┘
+
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
+┃ Layer (type)                     Output Shape                  Param # ┃
+┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
+│ original_img (InputLayer)       │ (None, 28, 28, 1)      │             0 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ conv2d_4 (Conv2D)               │ (None, 26, 26, 16)     │           160 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ conv2d_5 (Conv2D)               │ (None, 24, 24, 32)     │         4,640 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ max_pooling2d_1 (MaxPooling2D)  │ (None, 8, 8, 32)       │             0 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ conv2d_6 (Conv2D)               │ (None, 6, 6, 32)       │         9,248 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ conv2d_7 (Conv2D)               │ (None, 4, 4, 16)       │         4,624 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ global_max_pooling2d_1          │ (None, 16)             │             0 │
+│ (GlobalMaxPooling2D)            │                        │               │
+└─────────────────────────────────┴────────────────────────┴───────────────┘
 
@@ -544,27 +544,27 @@ autoencoder.summary() -
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
-┃ Layer (type)                     Output Shape                  Param # ┃
-┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
-│ encoded_img (InputLayer)        │ (None, 16)                │          0 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ reshape_1 (Reshape)             │ (None, 4, 4, 1)           │          0 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ conv2d_transpose_4              │ (None, 6, 6, 16)          │        160 │
-│ (Conv2DTranspose)               │                           │            │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ conv2d_transpose_5              │ (None, 8, 8, 32)          │      4,640 │
-│ (Conv2DTranspose)               │                           │            │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ up_sampling2d_1 (UpSampling2D)  │ (None, 24, 24, 32)        │          0 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ conv2d_transpose_6              │ (None, 26, 26, 16)        │      4,624 │
-│ (Conv2DTranspose)               │                           │            │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ conv2d_transpose_7              │ (None, 28, 28, 1)         │        145 │
-│ (Conv2DTranspose)               │                           │            │
-└─────────────────────────────────┴───────────────────────────┴────────────┘
+
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
+┃ Layer (type)                     Output Shape                  Param # ┃
+┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
+│ encoded_img (InputLayer)        │ (None, 16)             │             0 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ reshape_1 (Reshape)             │ (None, 4, 4, 1)        │             0 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ conv2d_transpose_4              │ (None, 6, 6, 16)       │           160 │
+│ (Conv2DTranspose)               │                        │               │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ conv2d_transpose_5              │ (None, 8, 8, 32)       │         4,640 │
+│ (Conv2DTranspose)               │                        │               │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ up_sampling2d_1 (UpSampling2D)  │ (None, 24, 24, 32)     │             0 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ conv2d_transpose_6              │ (None, 26, 26, 16)     │         4,624 │
+│ (Conv2DTranspose)               │                        │               │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ conv2d_transpose_7              │ (None, 28, 28, 1)      │           145 │
+│ (Conv2DTranspose)               │                        │               │
+└─────────────────────────────────┴────────────────────────┴───────────────┘
 
@@ -594,15 +594,15 @@ autoencoder.summary() -
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
-┃ Layer (type)                     Output Shape                  Param # ┃
-┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
-│ img (InputLayer)                │ (None, 28, 28, 1)         │          0 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ encoder (Functional)            │ (None, 16)                │     18,672 │
-├─────────────────────────────────┼───────────────────────────┼────────────┤
-│ decoder (Functional)            │ (None, 28, 28, 1)         │      9,569 │
-└─────────────────────────────────┴───────────────────────────┴────────────┘
+
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
+┃ Layer (type)                     Output Shape                  Param # ┃
+┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
+│ img (InputLayer)                │ (None, 28, 28, 1)      │             0 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ encoder (Functional)            │ (None, 16)             │        18,672 │
+├─────────────────────────────────┼────────────────────────┼───────────────┤
+│ decoder (Functional)            │ (None, 28, 28, 1)      │         9,569 │
+└─────────────────────────────────┴────────────────────────┴───────────────┘
 
@@ -767,7 +767,7 @@ Train the model by passing lists of NumPy arrays of inputs and targets: ```python # Dummy input data -title_data = np.random.randint(num_words, size=(1280, 10)) +title_data = np.random.randint(num_words, size=(1280, 12)) body_data = np.random.randint(num_words, size=(1280, 100)) tags_data = np.random.randint(2, size=(1280, num_tags)).astype("float32") @@ -786,11 +786,11 @@ model.fit(
``` Epoch 1/2 - 40/40 ━━━━━━━━━━━━━━━━━━━━ 1s 12ms/step - loss: 1.2673 + 40/40 ━━━━━━━━━━━━━━━━━━━━ 3s 57ms/step - loss: 1108.3792 Epoch 2/2 - 40/40 ━━━━━━━━━━━━━━━━━━━━ 0s 12ms/step - loss: 1.2440 + 40/40 ━━━━━━━━━━━━━━━━━━━━ 2s 54ms/step - loss: 621.3049 - + ```
@@ -844,45 +844,45 @@ model.summary() -
┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┓
-┃ Layer (type)         Output Shape       Param #  Connected to         ┃
-┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━┩
-│ img (InputLayer)    │ (None, 32, 32, 3) │       0 │ -                    │
-├─────────────────────┼───────────────────┼─────────┼──────────────────────┤
-│ conv2d_8 (Conv2D)   │ (None, 30, 30,    │     896 │ img[0][0]            │
-│                     │ 32)               │         │                      │
-├─────────────────────┼───────────────────┼─────────┼──────────────────────┤
-│ conv2d_9 (Conv2D)   │ (None, 28, 28,    │  18,496 │ conv2d_8[0][0]       │
-│                     │ 64)               │         │                      │
-├─────────────────────┼───────────────────┼─────────┼──────────────────────┤
-│ max_pooling2d_2     │ (None, 9, 9, 64)  │       0 │ conv2d_9[0][0]       │
-│ (MaxPooling2D)      │                   │         │                      │
-├─────────────────────┼───────────────────┼─────────┼──────────────────────┤
-│ conv2d_10 (Conv2D)  │ (None, 9, 9, 64)  │  36,928 │ max_pooling2d_2[0][ │
-├─────────────────────┼───────────────────┼─────────┼──────────────────────┤
-│ conv2d_11 (Conv2D)  │ (None, 9, 9, 64)  │  36,928 │ conv2d_10[0][0]      │
-├─────────────────────┼───────────────────┼─────────┼──────────────────────┤
-│ add (Add)           │ (None, 9, 9, 64)  │       0 │ conv2d_11[0][0],     │
-│                     │                   │         │ max_pooling2d_2[0][ │
-├─────────────────────┼───────────────────┼─────────┼──────────────────────┤
-│ conv2d_12 (Conv2D)  │ (None, 9, 9, 64)  │  36,928 │ add[0][0]            │
-├─────────────────────┼───────────────────┼─────────┼──────────────────────┤
-│ conv2d_13 (Conv2D)  │ (None, 9, 9, 64)  │  36,928 │ conv2d_12[0][0]      │
-├─────────────────────┼───────────────────┼─────────┼──────────────────────┤
-│ add_1 (Add)         │ (None, 9, 9, 64)  │       0 │ conv2d_13[0][0],     │
-│                     │                   │         │ add[0][0]            │
-├─────────────────────┼───────────────────┼─────────┼──────────────────────┤
-│ conv2d_14 (Conv2D)  │ (None, 7, 7, 64)  │  36,928 │ add_1[0][0]          │
-├─────────────────────┼───────────────────┼─────────┼──────────────────────┤
-│ global_average_poo… │ (None, 64)        │       0 │ conv2d_14[0][0]      │
-│ (GlobalAveragePool… │                   │         │                      │
-├─────────────────────┼───────────────────┼─────────┼──────────────────────┤
-│ dense_6 (Dense)     │ (None, 256)       │  16,640 │ global_average_pool… │
-├─────────────────────┼───────────────────┼─────────┼──────────────────────┤
-│ dropout (Dropout)   │ (None, 256)       │       0 │ dense_6[0][0]        │
-├─────────────────────┼───────────────────┼─────────┼──────────────────────┤
-│ dense_7 (Dense)     │ (None, 10)        │   2,570 │ dropout[0][0]        │
-└─────────────────────┴───────────────────┴─────────┴──────────────────────┘
+
┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┓
+┃ Layer (type)         Output Shape          Param #  Connected to      ┃
+┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━┩
+│ img (InputLayer)    │ (None, 32, 32, 3) │          0 │ -                 │
+├─────────────────────┼───────────────────┼────────────┼───────────────────┤
+│ conv2d_8 (Conv2D)   │ (None, 30, 30,    │        896 │ img[0][0]         │
+│                     │ 32)               │            │                   │
+├─────────────────────┼───────────────────┼────────────┼───────────────────┤
+│ conv2d_9 (Conv2D)   │ (None, 28, 28,    │     18,496 │ conv2d_8[0][0]    │
+│                     │ 64)               │            │                   │
+├─────────────────────┼───────────────────┼────────────┼───────────────────┤
+│ max_pooling2d_2     │ (None, 9, 9, 64)  │          0 │ conv2d_9[0][0]    │
+│ (MaxPooling2D)      │                   │            │                   │
+├─────────────────────┼───────────────────┼────────────┼───────────────────┤
+│ conv2d_10 (Conv2D)  │ (None, 9, 9, 64)  │     36,928 │ max_pooling2d_2[ │
+├─────────────────────┼───────────────────┼────────────┼───────────────────┤
+│ conv2d_11 (Conv2D)  │ (None, 9, 9, 64)  │     36,928 │ conv2d_10[0][0]   │
+├─────────────────────┼───────────────────┼────────────┼───────────────────┤
+│ add (Add)           │ (None, 9, 9, 64)  │          0 │ conv2d_11[0][0],  │
+│                     │                   │            │ max_pooling2d_2[ │
+├─────────────────────┼───────────────────┼────────────┼───────────────────┤
+│ conv2d_12 (Conv2D)  │ (None, 9, 9, 64)  │     36,928 │ add[0][0]         │
+├─────────────────────┼───────────────────┼────────────┼───────────────────┤
+│ conv2d_13 (Conv2D)  │ (None, 9, 9, 64)  │     36,928 │ conv2d_12[0][0]   │
+├─────────────────────┼───────────────────┼────────────┼───────────────────┤
+│ add_1 (Add)         │ (None, 9, 9, 64)  │          0 │ conv2d_13[0][0],  │
+│                     │                   │            │ add[0][0]         │
+├─────────────────────┼───────────────────┼────────────┼───────────────────┤
+│ conv2d_14 (Conv2D)  │ (None, 7, 7, 64)  │     36,928 │ add_1[0][0]       │
+├─────────────────────┼───────────────────┼────────────┼───────────────────┤
+│ global_average_poo… │ (None, 64)        │          0 │ conv2d_14[0][0]   │
+│ (GlobalAveragePool… │                   │            │                   │
+├─────────────────────┼───────────────────┼────────────┼───────────────────┤
+│ dense_6 (Dense)     │ (None, 256)       │     16,640 │ global_average_p… │
+├─────────────────────┼───────────────────┼────────────┼───────────────────┤
+│ dropout (Dropout)   │ (None, 256)       │          0 │ dense_6[0][0]     │
+├─────────────────────┼───────────────────┼────────────┼───────────────────┤
+│ dense_7 (Dense)     │ (None, 10)        │      2,570 │ dropout[0][0]     │
+└─────────────────────┴───────────────────┴────────────┴───────────────────┘
 
@@ -950,9 +950,9 @@ model.fit(
``` - 13/13 ━━━━━━━━━━━━━━━━━━━━ 2s 135ms/step - acc: 0.0976 - loss: 2.3050 - val_acc: 0.1350 - val_loss: 2.3056 + 13/13 ━━━━━━━━━━━━━━━━━━━━ 1s 60ms/step - acc: 0.1096 - loss: 2.3053 - val_acc: 0.1150 - val_loss: 2.2973 - + ```
diff --git a/guides/sequential_model.py b/guides/sequential_model.py index 2ab044c8dc..25f9cf6c04 100644 --- a/guides/sequential_model.py +++ b/guides/sequential_model.py @@ -6,6 +6,7 @@ Description: Complete guide to the Sequential model. Accelerator: GPU """ + """ ## Setup diff --git a/guides/transfer_learning.py b/guides/transfer_learning.py index bbcd04ef1d..1c82feccbb 100644 --- a/guides/transfer_learning.py +++ b/guides/transfer_learning.py @@ -6,6 +6,7 @@ Description: Complete guide to transfer learning & fine-tuning in Keras. Accelerator: GPU """ + """ ## Setup """ diff --git a/guides/writing_a_custom_training_loop_in_jax.py b/guides/writing_a_custom_training_loop_in_jax.py index 607f2d6cfa..107a72c634 100644 --- a/guides/writing_a_custom_training_loop_in_jax.py +++ b/guides/writing_a_custom_training_loop_in_jax.py @@ -6,6 +6,7 @@ Description: Writing low-level training & evaluation loops in JAX. Accelerator: None """ + """ ## Setup """ diff --git a/guides/writing_a_custom_training_loop_in_tensorflow.py b/guides/writing_a_custom_training_loop_in_tensorflow.py index 7384dded7f..7b99229b73 100644 --- a/guides/writing_a_custom_training_loop_in_tensorflow.py +++ b/guides/writing_a_custom_training_loop_in_tensorflow.py @@ -6,6 +6,7 @@ Description: Writing low-level training & evaluation loops in TensorFlow. Accelerator: None """ + """ ## Setup """ diff --git a/guides/writing_a_custom_training_loop_in_torch.py b/guides/writing_a_custom_training_loop_in_torch.py index 885a3c3f2f..9aebbcc2bf 100644 --- a/guides/writing_a_custom_training_loop_in_torch.py +++ b/guides/writing_a_custom_training_loop_in_torch.py @@ -6,6 +6,7 @@ Description: Writing low-level training & evaluation loops in PyTorch. Accelerator: None """ + """ ## Setup """ diff --git a/guides/writing_your_own_callbacks.py b/guides/writing_your_own_callbacks.py index 726e37ca86..c5a4d7eff5 100644 --- a/guides/writing_your_own_callbacks.py +++ b/guides/writing_your_own_callbacks.py @@ -6,6 +6,7 @@ Description: Complete guide to writing new Keras callbacks. Accelerator: GPU """ + """ ## Introduction