Ok now this should be the final one

master
Tuan-Dat Tran 2021-08-06 23:49:37 +02:00
parent cf05c7cc1b
commit 77e8268f65
2 changed files with 224 additions and 345 deletions

View File

@ -3,7 +3,7 @@
{
"cell_type": "code",
"execution_count": 1,
"id": "25366fc5",
"id": "4f19089f",
"metadata": {},
"outputs": [],
"source": [
@ -28,7 +28,7 @@
{
"cell_type": "code",
"execution_count": 2,
"id": "0394ccfe",
"id": "fb26acd0",
"metadata": {},
"outputs": [],
"source": [
@ -39,7 +39,7 @@
{
"cell_type": "code",
"execution_count": 3,
"id": "de4b0575",
"id": "369eda91",
"metadata": {},
"outputs": [],
"source": [
@ -68,7 +68,7 @@
{
"cell_type": "code",
"execution_count": 4,
"id": "fb2cbb23",
"id": "69ef44d7",
"metadata": {},
"outputs": [],
"source": [
@ -81,7 +81,7 @@
{
"cell_type": "code",
"execution_count": 5,
"id": "da88ad64",
"id": "7b98dc5f",
"metadata": {},
"outputs": [],
"source": [
@ -98,7 +98,7 @@
{
"cell_type": "code",
"execution_count": 6,
"id": "e0eb540b",
"id": "a4681cd9",
"metadata": {},
"outputs": [
{
@ -130,7 +130,7 @@
{
"cell_type": "code",
"execution_count": 7,
"id": "06d7c640",
"id": "5809f73a",
"metadata": {},
"outputs": [],
"source": [
@ -186,7 +186,7 @@
{
"cell_type": "code",
"execution_count": 8,
"id": "4d60cf83",
"id": "c8b0cedc",
"metadata": {},
"outputs": [],
"source": [
@ -202,7 +202,7 @@
{
"cell_type": "code",
"execution_count": 9,
"id": "e9ee34bc",
"id": "a00f25da",
"metadata": {},
"outputs": [],
"source": [
@ -232,7 +232,7 @@
{
"cell_type": "code",
"execution_count": 10,
"id": "435cc54c",
"id": "c79e017b",
"metadata": {},
"outputs": [],
"source": [
@ -251,7 +251,7 @@
{
"cell_type": "code",
"execution_count": 11,
"id": "f521d549",
"id": "4cacc665",
"metadata": {},
"outputs": [],
"source": [
@ -269,7 +269,7 @@
{
"cell_type": "code",
"execution_count": 12,
"id": "c0d35f7e",
"id": "f44a38fa",
"metadata": {},
"outputs": [],
"source": [
@ -298,7 +298,7 @@
{
"cell_type": "code",
"execution_count": 13,
"id": "9972009a",
"id": "0ef2c100",
"metadata": {},
"outputs": [
{
@ -312,7 +312,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 26179/26179 [01:29<00:00, 291.28it/s]\n"
"100%|██████████| 26179/26179 [01:28<00:00, 294.18it/s]\n"
]
}
],
@ -355,7 +355,7 @@
{
"cell_type": "code",
"execution_count": 14,
"id": "d65fcf35",
"id": "54adc91f",
"metadata": {},
"outputs": [
{
@ -385,14 +385,14 @@
{
"cell_type": "code",
"execution_count": 15,
"id": "e3b48487",
"id": "0c77f574",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
" 19%|█▉ | 3717/19640 [00:00<00:00, 18600.96it/s]"
" 18%|█▊ | 3624/19640 [00:00<00:00, 18199.99it/s]"
]
},
{
@ -406,7 +406,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 19640/19640 [00:01<00:00, 18565.30it/s]\n"
"100%|██████████| 19640/19640 [00:01<00:00, 19054.38it/s]\n"
]
}
],
@ -427,7 +427,7 @@
{
"cell_type": "code",
"execution_count": 16,
"id": "ba0c9798",
"id": "224a0acc",
"metadata": {},
"outputs": [],
"source": [
@ -465,13 +465,15 @@
" metrics=[\"acc\"],\n",
" )\n",
" \n",
" model.summary()\n",
" \n",
" return model"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "08d775aa",
"id": "8b1920de",
"metadata": {},
"outputs": [],
"source": [
@ -480,8 +482,6 @@
"def train(X_train, y_train, X_test, y_test):\n",
" model = build_model(X_train[0].shape, 52)\n",
" \n",
" model.summary()\n",
" \n",
" # Create a callback that saves the model's weights\n",
" model_checkpoint = ModelCheckpoint(filepath=checkpoint_path, monitor='loss', \n",
"\t\t\tsave_best_only=True)\n",
@ -504,7 +504,7 @@
{
"cell_type": "code",
"execution_count": 18,
"id": "0666829a",
"id": "830bc0c4",
"metadata": {},
"outputs": [],
"source": [
@ -529,7 +529,7 @@
{
"cell_type": "code",
"execution_count": 19,
"id": "adfe695d",
"id": "52c4202a",
"metadata": {
"tags": []
},
@ -539,8 +539,36 @@
"output_type": "stream",
"text": [
"Loaded weights...\n",
"CPU times: user 400 ms, sys: 145 ms, total: 545 ms\n",
"Wall time: 573 ms\n"
"Model: \"sequential\"\n",
"_________________________________________________________________\n",
"Layer (type) Output Shape Param # \n",
"=================================================================\n",
"flatten (Flatten) (None, 1050) 0 \n",
"_________________________________________________________________\n",
"dropout_10.0 (Dropout) (None, 1050) 0 \n",
"_________________________________________________________________\n",
"batchNorm (BatchNormalizatio (None, 1050) 4200 \n",
"_________________________________________________________________\n",
"HiddenDropout_10 (Dropout) (None, 1050) 0 \n",
"_________________________________________________________________\n",
"Hidden_1 (Dense) (None, 525) 551775 \n",
"_________________________________________________________________\n",
"HiddenDropout_20 (Dropout) (None, 525) 0 \n",
"_________________________________________________________________\n",
"Hidden_2 (Dense) (None, 262) 137812 \n",
"_________________________________________________________________\n",
"HiddenDropout_30 (Dropout) (None, 262) 0 \n",
"_________________________________________________________________\n",
"Hidden_3 (Dense) (None, 131) 34453 \n",
"_________________________________________________________________\n",
"Output (Dense) (None, 52) 6864 \n",
"=================================================================\n",
"Total params: 735,104\n",
"Trainable params: 733,004\n",
"Non-trainable params: 2,100\n",
"_________________________________________________________________\n",
"CPU times: user 338 ms, sys: 217 ms, total: 554 ms\n",
"Wall time: 574 ms\n"
]
}
],
@ -557,7 +585,7 @@
},
{
"cell_type": "markdown",
"id": "35a8741f",
"id": "a9ac22d1",
"metadata": {},
"source": [
"# Evaluation"
@ -566,7 +594,7 @@
{
"cell_type": "code",
"execution_count": 20,
"id": "f0fa25f6",
"id": "6c7a4243",
"metadata": {},
"outputs": [],
"source": [
@ -577,7 +605,7 @@
{
"cell_type": "code",
"execution_count": 21,
"id": "fc983eae",
"id": "81f43c20",
"metadata": {},
"outputs": [
{
@ -655,8 +683,8 @@
" macro avg 0.79 0.78 0.78 3928\n",
"weighted avg 0.77 0.77 0.76 3928\n",
"\n",
"CPU times: user 1.01 s, sys: 209 ms, total: 1.22 s\n",
"Wall time: 966 ms\n"
"CPU times: user 998 ms, sys: 195 ms, total: 1.19 s\n",
"Wall time: 963 ms\n"
]
}
],
@ -685,7 +713,7 @@
{
"cell_type": "code",
"execution_count": 22,
"id": "70716586",
"id": "3fbedc43",
"metadata": {},
"outputs": [],
"source": [
@ -720,11 +748,13 @@
},
{
"cell_type": "code",
"execution_count": null,
"id": "d28c3de8",
"execution_count": 23,
"id": "12fec3a9",
"metadata": {},
"outputs": [],
"source": []
"source": [
"exit()"
]
}
],
"metadata": {

File diff suppressed because one or more lines are too long