Skip to content

Commit 11e68ca

Browse files
committed
Updates to chapter 12 and chapter 16 notebooks
1 parent 7732282 commit 11e68ca

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

chapter12_object-detection.ipynb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -618,11 +618,7 @@
618618
},
619619
"outputs": [],
620620
"source": [
621-
"url = (\n",
622-
" \"https://upload.wikimedia.org/wikipedia/commons/thumb/7/7d/\"\n",
623-
" \"A_Sunday_on_La_Grande_Jatte%2C_Georges_Seurat%2C_1884.jpg/\"\n",
624-
" \"1280px-A_Sunday_on_La_Grande_Jatte%2C_Georges_Seurat%2C_1884.jpg\"\n",
625-
")\n",
621+
"url = \"https://s3.us-east-1.amazonaws.com/book.keras.io/3e/seurat.jpg\"\n",
626622
"path = keras.utils.get_file(origin=url)\n",
627623
"image = np.array([keras.utils.load_img(path)])"
628624
]

chapter16_text-generation.ipynb

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
"source": [
181181
"import tensorflow as tf\n",
182182
"\n",
183-
"batch_size = 128\n",
183+
"batch_size = 64\n",
184184
"sequence_length = 256\n",
185185
"suffix = np.array([tokenizer.token_to_id(\"<|endoftext|>\")])\n",
186186
"\n",
@@ -206,7 +206,7 @@
206206
},
207207
"outputs": [],
208208
"source": [
209-
"num_batches = 29373\n",
209+
"num_batches = 58746\n",
210210
"num_val_batches = 500\n",
211211
"num_train_batches = num_batches - num_val_batches\n",
212212
"val_ds = ds.take(num_val_batches).repeat()\n",
@@ -359,6 +359,19 @@
359359
"plt.show()"
360360
]
361361
},
362+
{
363+
"cell_type": "code",
364+
"execution_count": 0,
365+
"metadata": {
366+
"colab_type": "code"
367+
},
368+
"outputs": [],
369+
"source": [
370+
"# \u26a0\ufe0fNOTE\u26a0\ufe0f: If you can run the following with a Colab Pro GPU, we suggest you\n",
371+
"# do so. This fit() call will take many hours on free tier GPUs. You can also\n",
372+
"# reduce steps_per_epoch to try the code with a less trained model."
373+
]
374+
},
362375
{
363376
"cell_type": "code",
364377
"execution_count": 0,

0 commit comments

Comments
 (0)