Skip to content

Commit 6234b33

Browse files
committed
Adapt to new Keras version
1 parent 8cf7ce5 commit 6234b33

File tree

3 files changed

+189
-121
lines changed

3 files changed

+189
-121
lines changed

source-code/keras/imdb_rnn.ipynb

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# IMDB: recursive neural networks"
7+
"# IMDB: recurrent neural networks"
88
]
99
},
1010
{
@@ -35,6 +35,7 @@
3535
}
3636
],
3737
"source": [
38+
"from tensorflow import keras\n",
3839
"from keras.datasets import imdb\n",
3940
"from keras.preprocessing import sequence\n",
4041
"import numpy as np\n",
@@ -129,8 +130,8 @@
129130
"outputs": [],
130131
"source": [
131132
"from keras.layers import Activation, Dense, Dropout\n",
132-
"from keras.layers.embeddings import Embedding\n",
133-
"from keras.layers.recurrent import GRU\n",
133+
"from keras.layers import Embedding\n",
134+
"from keras.layers import GRU\n",
134135
"from keras.models import Sequential\n",
135136
"from keras.optimizers import Adam"
136137
]
@@ -313,7 +314,7 @@
313314
"metadata": {},
314315
"outputs": [],
315316
"source": [
316-
"from keras.layers.recurrent import LSTM"
317+
"from keras.layers import LSTM"
317318
]
318319
},
319320
{
@@ -393,9 +394,7 @@
393394
{
394395
"cell_type": "code",
395396
"execution_count": 17,
396-
"metadata": {
397-
"scrolled": false
398-
},
397+
"metadata": {},
399398
"outputs": [
400399
{
401400
"name": "stdout",
@@ -474,7 +473,7 @@
474473
],
475474
"metadata": {
476475
"kernelspec": {
477-
"display_name": "Python 3",
476+
"display_name": "Python 3 (ipykernel)",
478477
"language": "python",
479478
"name": "python3"
480479
},
@@ -488,9 +487,9 @@
488487
"name": "python",
489488
"nbconvert_exporter": "python",
490489
"pygments_lexer": "ipython3",
491-
"version": "3.7.3"
490+
"version": "3.11.8"
492491
}
493492
},
494493
"nbformat": 4,
495-
"nbformat_minor": 2
494+
"nbformat_minor": 4
496495
}

0 commit comments

Comments
 (0)