Skip to content

Commit 1792200

Browse files
committed
Created using Colab
1 parent 457cb33 commit 1792200

File tree

1 file changed

+151
-2
lines changed

1 file changed

+151
-2
lines changed

ch15_explore.ipynb

Lines changed: 151 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"metadata": {
55
"colab": {
66
"provenance": [],
7-
"authorship_tag": "ABX9TyPgxd7O1QoOyi3/mqM6MmO6",
7+
"authorship_tag": "ABX9TyPSsHslMTuprQrQlyl3voXt",
88
"include_colab_link": true
99
},
1010
"kernelspec": {
@@ -40,10 +40,159 @@
4040
},
4141
{
4242
"cell_type": "code",
43-
"source": [],
43+
"source": [
44+
"from packaging import version\n",
45+
"import tensorflow as tf\n",
46+
"\n",
47+
"assert version.parse(tf.__version__) >= version.parse(\"2.8.0\")"
48+
],
4449
"metadata": {
4550
"id": "9apO34vPDaQT"
4651
},
52+
"execution_count": 2,
53+
"outputs": []
54+
},
55+
{
56+
"cell_type": "code",
57+
"source": [
58+
"import matplotlib.pyplot as plt\n",
59+
"\n",
60+
"plt.rc('font', size=14)\n",
61+
"plt.rc('axis', labelsize=14, titlesize=14)\n",
62+
"plt.rc('legend', fontsize=14)\n",
63+
"plt.rc('xticks', labelsize=14)\n",
64+
"plt.rc('yticks', labelsize=10)"
65+
],
66+
"metadata": {
67+
"id": "Vrt3lyeRGy1D"
68+
},
69+
"execution_count": null,
70+
"outputs": []
71+
},
72+
{
73+
"cell_type": "code",
74+
"source": [
75+
"from pathlib import Path\n",
76+
"\n",
77+
"IMAGE_PATH = Path()/ \"images\"/ \"rnn\"\n",
78+
"IMAGE_PATH.mkdir(parents=True, exist_ok=True)\n",
79+
"\n",
80+
"def save_fig(fig_id, tight_layout=True, fig_extension=\"png\", resolution=300):\n",
81+
" path= IMAGE_PATH/ f\"{fig_id}.{fig_extension}\"\n",
82+
" if tight_layout:\n",
83+
" plt.tight_layout\n",
84+
" plt.savefig(path, fig_extension, dpi=resolution)\n",
85+
""
86+
],
87+
"metadata": {
88+
"id": "WMPngWvGHGcm"
89+
},
90+
"execution_count": null,
91+
"outputs": []
92+
},
93+
{
94+
"cell_type": "code",
95+
"source": [
96+
"if not tf.config.list_physical_devices('GPU'):\n",
97+
" print(\"No GPU was detected. Neural nets can be very slow without a GPU.\")\n",
98+
" if \"google.colab\" in sys.modules:\n",
99+
" print(\"Go to Runtime > Change runtime and select a GPU hardware accelerator\")\n",
100+
" if \"kaggle_secrets\" in sys.modules:\n",
101+
" print(\"Go to Settings > Accelerator and select GPU.\")"
102+
],
103+
"metadata": {
104+
"id": "dJMoHuGbHGY2"
105+
},
106+
"execution_count": null,
107+
"outputs": []
108+
},
109+
{
110+
"cell_type": "markdown",
111+
"source": [
112+
"# Basic RNNs"
113+
],
114+
"metadata": {
115+
"id": "YmxoI1BfPuCO"
116+
}
117+
},
118+
{
119+
"cell_type": "code",
120+
"source": [],
121+
"metadata": {
122+
"id": "w_cBddUnHGWW"
123+
},
124+
"execution_count": null,
125+
"outputs": []
126+
},
127+
{
128+
"cell_type": "code",
129+
"source": [],
130+
"metadata": {
131+
"id": "7kSxw0L5HGTG"
132+
},
133+
"execution_count": null,
134+
"outputs": []
135+
},
136+
{
137+
"cell_type": "code",
138+
"source": [],
139+
"metadata": {
140+
"id": "gg2wpfqIHGQO"
141+
},
142+
"execution_count": null,
143+
"outputs": []
144+
},
145+
{
146+
"cell_type": "code",
147+
"source": [],
148+
"metadata": {
149+
"id": "iT8p_OOfHGNl"
150+
},
151+
"execution_count": null,
152+
"outputs": []
153+
},
154+
{
155+
"cell_type": "code",
156+
"source": [],
157+
"metadata": {
158+
"id": "okWmHPLOHGKl"
159+
},
160+
"execution_count": null,
161+
"outputs": []
162+
},
163+
{
164+
"cell_type": "code",
165+
"source": [],
166+
"metadata": {
167+
"id": "sjvnxqIvHGFF"
168+
},
169+
"execution_count": null,
170+
"outputs": []
171+
},
172+
{
173+
"cell_type": "code",
174+
"source": [],
175+
"metadata": {
176+
"id": "haKD9v2tHGCI"
177+
},
178+
"execution_count": null,
179+
"outputs": []
180+
},
181+
{
182+
"cell_type": "code",
183+
"source": [],
184+
"metadata": {
185+
"id": "XXls8a3mHF82"
186+
},
187+
"execution_count": null,
188+
"outputs": []
189+
},
190+
{
191+
"cell_type": "code",
192+
"source": [],
193+
"metadata": {
194+
"id": "OoLyAuxOHF29"
195+
},
47196
"execution_count": null,
48197
"outputs": []
49198
}

0 commit comments

Comments
 (0)