Skip to content

Commit bb1d6e2

Browse files
committed
update
1 parent 3fa35c7 commit bb1d6e2

File tree

12 files changed

+91866
-91604
lines changed

12 files changed

+91866
-91604
lines changed
7.48 MB
Binary file not shown.
1.57 MB
Binary file not shown.
9.77 KB
Binary file not shown.
4.44 KB
Binary file not shown.
44.9 MB
Binary file not shown.
9.45 MB
Binary file not shown.
58.6 KB
Binary file not shown.
28.2 KB
Binary file not shown.

doc/pub/week7/ipynb/rnncode.ipynb

Lines changed: 90984 additions & 91598 deletions
Large diffs are not rendered by default.

doc/pub/week7/ipynb/week7.ipynb

Lines changed: 180 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -831,9 +831,68 @@
831831
"id": "a8aea84e",
832832
"metadata": {
833833
"collapsed": false,
834-
"editable": true
834+
"editable": true,
835+
"jupyter": {
836+
"outputs_hidden": false
837+
}
835838
},
836-
"outputs": [],
839+
"outputs": [
840+
{
841+
"name": "stdout",
842+
"output_type": "stream",
843+
"text": [
844+
"Model: \"sequential\"\n",
845+
"_________________________________________________________________\n",
846+
" Layer (type) Output Shape Param # \n",
847+
"=================================================================\n",
848+
" lstm (LSTM) (None, 128) 80384 \n",
849+
" \n",
850+
" dense (Dense) (None, 10) 1290 \n",
851+
" \n",
852+
"=================================================================\n",
853+
"Total params: 81,674\n",
854+
"Trainable params: 81,674\n",
855+
"Non-trainable params: 0\n",
856+
"_________________________________________________________________\n",
857+
"Epoch 1/10\n"
858+
]
859+
},
860+
{
861+
"name": "stderr",
862+
"output_type": "stream",
863+
"text": [
864+
"2026-03-05 08:05:52.803822: W tensorflow/tsl/platform/profile_utils/cpu_utils.cc:128] Failed to get CPU frequency: 0 Hz\n"
865+
]
866+
},
867+
{
868+
"name": "stdout",
869+
"output_type": "stream",
870+
"text": [
871+
"750/750 [==============================] - 12s 14ms/step - loss: 0.4758 - accuracy: 0.8460 - val_loss: 0.1830 - val_accuracy: 0.9452\n",
872+
"Epoch 2/10\n",
873+
"750/750 [==============================] - 14s 18ms/step - loss: 0.1485 - accuracy: 0.9551 - val_loss: 0.1452 - val_accuracy: 0.9563\n",
874+
"Epoch 3/10\n",
875+
"750/750 [==============================] - 11s 15ms/step - loss: 0.1011 - accuracy: 0.9695 - val_loss: 0.1035 - val_accuracy: 0.9682\n",
876+
"Epoch 4/10\n",
877+
"750/750 [==============================] - 11s 14ms/step - loss: 0.0776 - accuracy: 0.9754 - val_loss: 0.0829 - val_accuracy: 0.9752\n",
878+
"Epoch 5/10\n",
879+
"750/750 [==============================] - 12s 16ms/step - loss: 0.0619 - accuracy: 0.9806 - val_loss: 0.0824 - val_accuracy: 0.9778\n",
880+
"Epoch 6/10\n",
881+
"750/750 [==============================] - 12s 16ms/step - loss: 0.0520 - accuracy: 0.9841 - val_loss: 0.0626 - val_accuracy: 0.9816\n",
882+
"Epoch 7/10\n",
883+
"750/750 [==============================] - 10s 14ms/step - loss: 0.0433 - accuracy: 0.9871 - val_loss: 0.0676 - val_accuracy: 0.9797\n",
884+
"Epoch 8/10\n",
885+
"750/750 [==============================] - 11s 15ms/step - loss: 0.0377 - accuracy: 0.9880 - val_loss: 0.0548 - val_accuracy: 0.9848\n",
886+
"Epoch 9/10\n",
887+
"750/750 [==============================] - 10s 14ms/step - loss: 0.0340 - accuracy: 0.9892 - val_loss: 0.0656 - val_accuracy: 0.9809\n",
888+
"Epoch 10/10\n",
889+
"750/750 [==============================] - 10s 14ms/step - loss: 0.0309 - accuracy: 0.9900 - val_loss: 0.0537 - val_accuracy: 0.9843\n",
890+
"313/313 - 3s - loss: 0.0528 - accuracy: 0.9828 - 3s/epoch - 9ms/step\n",
891+
"\n",
892+
"Test accuracy: 0.9828\n"
893+
]
894+
}
895+
],
837896
"source": [
838897
"\"\"\"\n",
839898
"Key points:\n",
@@ -909,13 +968,110 @@
909968
},
910969
{
911970
"cell_type": "code",
912-
"execution_count": 2,
971+
"execution_count": null,
913972
"id": "efc6f925",
914973
"metadata": {
915974
"collapsed": false,
916-
"editable": true
975+
"editable": true,
976+
"jupyter": {
977+
"outputs_hidden": false
978+
}
917979
},
918-
"outputs": [],
980+
"outputs": [
981+
{
982+
"name": "stdout",
983+
"output_type": "stream",
984+
"text": [
985+
"Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz\n",
986+
"Failed to download (trying next):\n",
987+
"HTTP Error 404: Not Found\n",
988+
"\n",
989+
"Downloading https://ossci-datasets.s3.amazonaws.com/mnist/train-images-idx3-ubyte.gz\n",
990+
"Downloading https://ossci-datasets.s3.amazonaws.com/mnist/train-images-idx3-ubyte.gz to ./data/MNIST/raw/train-images-idx3-ubyte.gz\n"
991+
]
992+
},
993+
{
994+
"name": "stderr",
995+
"output_type": "stream",
996+
"text": [
997+
"100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9912422/9912422 [00:01<00:00, 8199396.29it/s]\n"
998+
]
999+
},
1000+
{
1001+
"name": "stdout",
1002+
"output_type": "stream",
1003+
"text": [
1004+
"Extracting ./data/MNIST/raw/train-images-idx3-ubyte.gz to ./data/MNIST/raw\n",
1005+
"\n",
1006+
"Downloading http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz\n",
1007+
"Failed to download (trying next):\n",
1008+
"HTTP Error 404: Not Found\n",
1009+
"\n",
1010+
"Downloading https://ossci-datasets.s3.amazonaws.com/mnist/train-labels-idx1-ubyte.gz\n",
1011+
"Downloading https://ossci-datasets.s3.amazonaws.com/mnist/train-labels-idx1-ubyte.gz to ./data/MNIST/raw/train-labels-idx1-ubyte.gz\n"
1012+
]
1013+
},
1014+
{
1015+
"name": "stderr",
1016+
"output_type": "stream",
1017+
"text": [
1018+
"100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 28881/28881 [00:00<00:00, 265140.85it/s]\n"
1019+
]
1020+
},
1021+
{
1022+
"name": "stdout",
1023+
"output_type": "stream",
1024+
"text": [
1025+
"Extracting ./data/MNIST/raw/train-labels-idx1-ubyte.gz to ./data/MNIST/raw\n",
1026+
"\n",
1027+
"Downloading http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz\n",
1028+
"Failed to download (trying next):\n",
1029+
"HTTP Error 404: Not Found\n",
1030+
"\n",
1031+
"Downloading https://ossci-datasets.s3.amazonaws.com/mnist/t10k-images-idx3-ubyte.gz\n",
1032+
"Downloading https://ossci-datasets.s3.amazonaws.com/mnist/t10k-images-idx3-ubyte.gz to ./data/MNIST/raw/t10k-images-idx3-ubyte.gz\n"
1033+
]
1034+
},
1035+
{
1036+
"name": "stderr",
1037+
"output_type": "stream",
1038+
"text": [
1039+
"100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1648877/1648877 [00:00<00:00, 2255667.19it/s]\n"
1040+
]
1041+
},
1042+
{
1043+
"name": "stdout",
1044+
"output_type": "stream",
1045+
"text": [
1046+
"Extracting ./data/MNIST/raw/t10k-images-idx3-ubyte.gz to ./data/MNIST/raw\n",
1047+
"\n",
1048+
"Downloading http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz\n",
1049+
"Failed to download (trying next):\n",
1050+
"HTTP Error 404: Not Found\n",
1051+
"\n",
1052+
"Downloading https://ossci-datasets.s3.amazonaws.com/mnist/t10k-labels-idx1-ubyte.gz\n",
1053+
"Downloading https://ossci-datasets.s3.amazonaws.com/mnist/t10k-labels-idx1-ubyte.gz to ./data/MNIST/raw/t10k-labels-idx1-ubyte.gz\n"
1054+
]
1055+
},
1056+
{
1057+
"name": "stderr",
1058+
"output_type": "stream",
1059+
"text": [
1060+
"100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4542/4542 [00:00<00:00, 2208756.96it/s]\n"
1061+
]
1062+
},
1063+
{
1064+
"name": "stdout",
1065+
"output_type": "stream",
1066+
"text": [
1067+
"Extracting ./data/MNIST/raw/t10k-labels-idx1-ubyte.gz to ./data/MNIST/raw\n",
1068+
"\n",
1069+
"Epoch [1/10], Step [100/938], Loss: 0.5951\n",
1070+
"Epoch [1/10], Step [200/938], Loss: 0.2689\n",
1071+
"Epoch [1/10], Step [300/938], Loss: 0.3001\n"
1072+
]
1073+
}
1074+
],
9191075
"source": [
9201076
"\"\"\"\n",
9211077
"Key components:\n",
@@ -1049,7 +1205,25 @@
10491205
]
10501206
}
10511207
],
1052-
"metadata": {},
1208+
"metadata": {
1209+
"kernelspec": {
1210+
"display_name": "Python 3 (ipykernel)",
1211+
"language": "python",
1212+
"name": "python3"
1213+
},
1214+
"language_info": {
1215+
"codemirror_mode": {
1216+
"name": "ipython",
1217+
"version": 3
1218+
},
1219+
"file_extension": ".py",
1220+
"mimetype": "text/x-python",
1221+
"name": "python",
1222+
"nbconvert_exporter": "python",
1223+
"pygments_lexer": "ipython3",
1224+
"version": "3.9.15"
1225+
}
1226+
},
10531227
"nbformat": 4,
10541228
"nbformat_minor": 5
10551229
}

0 commit comments

Comments
 (0)